Having attended several music festivals over the years, there is a vast list of possible situations that could happen, so here are some tips on surviving.
1. Boots and high tops
Regardless of the forecast, rainstorms happen(especially in the summer), so to be safe, always pack a pair of rain boots, or always wear, my personal favorite, converse with emphasis on high tops...
2. Blankets
If it's a weekend-long festival, you're going to be hot, tired, and your feet are going to hurt, so bring a blanket to lay out on, claim your space, etc. This way, if you leave to grab food, your spot will, most likely, still be claimed and if you want to take a nap, no worries about cigarettes getting in your hair.
3. Food trucks
Food trucks and festival food is usually, surprisingly good, so before you rush to pick a "safe/clean" looking place, scope the scene and find several places that you might not typically try out. Rookie mistake.
4. Let loose
Music festivals are meant to be fun, so have a good time and forget your worries. Get into the music, the crowd, even see bands you've never heard of before, you'll be surprised and make the most of your weekend.
5. Hydrate
If it's summer, definitely. If spring, definitely. Regardless, drink water and plenty of it.