This is what I do, if something like that happens (reaching for something that can hurt the child). First, I grab their hand with my hand. Then I slap MY hand. This makes a slap sound, it is alarming, it will get their attention, but it does not cause pain in their hand.
It works really well.