What is recommended a lot is to take your hamster in its' cage into your bathtub and open the door to let it walk out. This way you are not yet trying to hold it so it will earn your trust. Take a few treats or food in there and feed them some, stroke them and speak gently. Why it is better in the bath is so the hamster cannot escape (unless it is an excellent jumper!) do this regularly until the hamster gets used to your scent and voice, and earns your trust. Then, when you are ready, put your hands together and put a treat in the middle, this way the hamster will climb into your hands to get the treat. If it does not, it is not yet comfortable with you so keep trying till it is. Then gently cup one hand over its back, do not squeeze it as hamsters find this stressful, which may lead to biting.
Hope this helps! :)