I have a betta who backs up from the glass when I move my finger towards him and comes closer when I pull my finger back. I feel like he's trying to square dance or something, lol.
But, the same fish has associated my fingers when I hold them above the water with food so he will follow them around. He also hovers around my hand when I have to move around decorations or try to take the thermometer out of his tank, LOL. I'm always scared to take out the thermometer because I feel like he's going to lunge at my hand expecting food.
But anyways, I get them to follow my finger by being patient and holding the pellets above the water until they come near my hand, then I drop the pellets really close to them. Eventually they learn that hand= food (when it's above the tank, lol).