This is something that a lot of people tend to ask about, so here’s my take on it.
First, clean your hands thoroughly!
Step 1: Spend time near the tank to get your fish used to your presence.
Step 2: Get your goldfish used to your hands being in the tank.
Step 3: Feed them by putting your food-filled hand in the water and making sure they see you drop the food. Let them eat it away from your hand.
Step 4: Start holding the food in your hand while staying motionless. Let them come to you and investigate without moving your hand.
Step 5: Your goldfish will begin to eat from your hand!