Make a sweat-dissolving paste using either aspirin or baking soda. For an aspirin paste, crush two aspirin into a powder, and dilute the powder in one-half cup of water. Apply the mixture to the stain, and let it set for two hours. For a baking soda paste, mix equal parts baking soda and water, and sponge it onto the stain. Leave the baking soda set for 15 minutes.
Place the hat on a hat shaper -- a plastic device that hold a hat's shape while it is being washed. It's not a must, but if you are worried about your hat retaining its form, it can be an asset.
Place your hat in the washing machine. Wash it with a mild detergent, using cold water and the gentle cycle. Remove the hat from the washing machine and allow it to air-dry, on the hat shaper, overnight.