I just use a flat head screw driver and gently pry it off. I pry in small amounts on several different spots around it so I can try to get it to come straight off the shaft.
I don't think i would smack it with a hammer,but if thats how you do OK.I also just pop them off with a screwdriver,then if that does not work maybe tap if lightly but i would be afraid if i hit it to hard it may damage the crank or conrod just because most have a little play in them may even damage the rear bearing. just a thought
Putting the fly wheel on the edge of a bench or between the jaws of a vise works well. I then lightly tap the crank with a block of wood or a rubber mallet.