First watch your hammy for a few days to find out when it is awake and active - the best time to start taming. Note its favorite foods so you can use them to overcome its fear. Now start putting food straight on the cage floor, so your hamster gets used to your hand and learns that it brings food. After a few days, leave your hand there while the hamster eats.
When your hamster is confident enough to eat beside your hand, put the food in the palm of your hand. It may a while before the hamster will eat from your hand without fear. When it does, you can stroke it gently with one finger along its back. Never stroke its head.
Next, get your hamster used to being picked up. When it is eating from your hand, cup the other hand over it, and lift it gently a little way off the ground for a few moments at a time. After a few more days, if your hammy seems happy being lifted up, you can take it right out of the cage in your cupped hands.
Play with it near the ground so that if you drop it or it jumps out of your hands, it doesn't have a long way to fall. Let it run from one hand to the other. Soon it will be confident enough to run along your arm.
You can alternatively gently hold the hamster by it's scruff to prevent falls.
Taming is a long process and takes a great deal of patience. Do not rush it as it can cause you to lose your hamsters trust. Taming times vary greatly depending on the hamster.