Hand washing: With a gentle non-bleach detergent and warm water & air dry.
To spot clean: Mix warm water with a laundry detergent. Don't use a detergent that contains bleach or bleach alternative, as they can stain the fabric. With a clean white cloth and the solution, spot clean the exterior. If there are stubborn sweat stains on the inner brim, rub them with shampoo to help loosen body oils. Rinse the hat with cool water to remove the soapy residue. Then let it air dry.
To help prevent staining: On your clean hat, spray a stain repellant, which you can find at a local sporting goods store. For quick freshening, sprinkle a little baking soda on the inner side of the hat and allow it to sit for a few minutes. Then shake out the baking soda.