Never hit them. But, if they keep trying to touch the hot stove, let them. Then, they will learn not to touch the hot stove. I do not advocate hitting children, but I do believe pain is there for a reason. I also am not saying let them run into the street and learn that way. I am saying that sometimes people do have to learn the hard way.
But still, do not spank.