It's a problem we can all relate to. Anyone who has ever opened a paint, finish, or stain can knows the problem: if you don't use it all, you have to close it again. Hammers provide too much direct force, and can bend the lid, the lip, or the can itself. A rubber mallet is better, but you could shoot paint or finish out at you, and you'll cover the mallet in the material, which could get transferred to another project. Plus, if you're like me, the mallet always seems to be in another room.
Step on it. Seriously. According to finishing master Bob Flexner, it's definitely the best way to go. And this guy has opened and closed a lot of cans. The firm but soft sole of your shoe plus your body weight makes a great combination of relatively indirect force to snap things up nicely without mess.
Just line up the lid, and place one foot on the can. Stand on one leg, and you'll feel it set. Turn your foot (or the can) ninety degrees, and step on it one more time to seal it in the other two directions. Done and done.
Just make sure you check your sole or walk around in the grass or on a drop cloth just to make sure you don't track any product around.