What part the operation are you having problems with?
If it’s just the attach part then:
1 - go to the character’s skeleton and create a socket at the hand:
2 - when you id the object to pickup, in this case using a linetrace, just attached it to the socket of the mesh: