One rule is nearly universal: don’t submerge your hat in water! Most hats use sizing of some sort to maintain the shape of the hat. Felts and technical materials allow for use in the rain, but unless you’re wearing a floppy hat without any structure whatsoever, a bath is going to destroy your hat.
The best way to care for your hat is by spot cleaning it with a warm damp cloth. Don’t use any harsh cleaning chemicals that could ultimately damage the quality of the hat (unless you’re into that – distressed is a VERY cool look). Allow your hat to air dry in the shade. Do not use a dryer or leave it in the sun on a really hot day, as you’ll likely end up with a very different shape to your hat.
Extend the life of your hat by handling it only by the brim. Yes, the brim. The pinch of your hat is not a handle – that’s what the brim is for. The brim is designed to be handled.