Always make sure your hair is completely dry before topping it with your favorite lid. You should also use minimal styling product. Once you get back inside and remove the cap, run damp hands through your hair to reboot your styler—and your style.
Pick your headwear with care. If you want your hair to look good after removing a cap, opt for something that's not too heavy or too tight. And be sure to slide it carefully onto your head, from front to back, to avoid messing up the hair underneath.
Many problems will go away if your hair is better hydrated. To amp up the moisture, switch your regular shampoo for a conditioning one. Two-in-one shampoos such as Redkin for Men 2-in-1 ($12) and Axe Dual 2-in-1 ($6) are both good single-bottle options.