This is a variation of a jugglers' trick called the Half Shower.
Start with one hat on the head, and one in each hand, held in an outside grip. Throw one hat across the body, flat, with no spin. As soon as you've let go of this hat, take off the one on your head with your now-empty hand. The other hand slaps/places its hat onto the head, just in the nick of time to then catch the first (thrown) hat. You should now be back where you started.
The timing is a little odd for this one, but just remember "Throw.... take....place....catch", and you'll get it.
You can also throw in the occasional little fake throw for a bit of light relief.