Sorry to hear that! (my record is 3 flats on one ride, so I can sympathize).
Without knowing any specifics about you or your equipment:
1. Watch where you ride. (Yeah "duh" ... but it does help! I'm talking debris or holes/cracks in the road)
2. Try a heavier tire (watch how many grams the tires weigh) or maybe a wider tire (19/23/25/28mm).
3. Inflate to the proper pressure (do you have a guage on your pump?).
Hang in there and keep experimenting, eventually you'll figure out what works for
you. I ride only on Michelin tires while other's will never ride them.

Everyone's needs are different.