Ouch! Moisture is the enemy. Good wicking shorts, with monkey butt powder ( yes I said monkey butt, it worked
on the kids when they were in diapers...and now dad when hiking) have helped me. Powder up before taking off. And have some desitin cream in the kit just in case. Will relieve the discomfort if you chaff.
A second on the mini bottle of Gold Bond. Monkey Butt is a good choice but you would have to store it in a smaller container than what it comes it. Try the GB though, you will faintly hear Angels sing when you put it on your bits.
Bag Balm will help heal after the chaffing has already set in. I used to bicycle commute with a 28 mile round trip to work and have dealt with my fair share of monkey butt. Gold Bond powder in the biking shorts usually kept me from chaffing. But if I did chafe a little Bag Balm would heal it up within a day or two.