I like to wear Headsweats visors when I run. They keep the sun out of my eyes and they work hard to keep sweat off of my face.
Keeping my hats clean is easy with purpose-made protective cages like these cap washing frames that come in a 3-pack. I use them on the top rack of my dishwasher with a powder-based detergent. Some cap washers can also be used in your clothes washing machine, but they are usually not recommended for front-loaders like ours.
Sturdy cap washers like these make sure your hat keeps its shape (important for the elastic band on my Headsweats) while it goes through a hot water washing cycle. When the wash is done, the caps come out of the washer still in the frame and I let them dry in the frame, so the hats continue to keep their shape. These cap washers are sold in a convenient three-pack but I have been lucky to find a couple of these at Goodwill.
Cap washers are also great for cleaning used hats! I have purchased costume or character hats for various Disney races via Poshmark.com and Goodwill -- one cycle through the wash cleans them up just fine. Goodwill and thrift stores are a great place to browse for affordable novelty hats you only want to wear for one race or costume. I've based entire costumes on funny hats I've randomly found at Goodwill!