1. Choose the right hat: Choose a hat that fits your head. If you've never been fitted for a hat, go get fitted. Stay away from anything that is too tight and puts pressure anywhere on your head. Also choose a hat made with quality, light materials. In the summer a straw hat is a great choice because it lets your hair breathe beneath the hat and in the winter a cotton-blend hat will be best. Wool hats tend to stress and damage hair, especially if that hair has been chemically treated so stay away from wool.
2. Prevention is the best trick: Keep your hair dry; moisture under the hat (like any humidity) will cause your hair to be frizzy. For ladies with long hair, a ponytail or a knot is going to be your best bet. For short hair, rake your hair back, re-shaping your hair as needed when removing the hat. Alternatively, use a scarf to protect your hair underneath the hat.
3. Getting rid of "hat head": If you've slipped up and gotten hat head, the single most important thing to remember is do NOT brush your hair. Instead take a small amount of gel or anti-frizz pomade and run it through your hair with your fingers to re-style your hair. Your fingers add air where a brush will just push things down. If you have static on your hair, use a clean dryer sheet to take away the static cling.