What can I do to prevent UTIs?

Allexis
The first time I had sex I tried to pee but I couldn't and then I got antibiotics two days later (which was scary because I was dizzy, had all the pain (back,stomach,chest), and my fever was over 100 (my fevers have always run high). So finally I got antibiotics and didn't die and then after that cleared up about 2 weeks later I had sex again. This time I peed before and after sex and I drank water before and after (also I've generally been drinking a lot of water- almost 2 liters a day), but I still woke up with a uti the next morning. I'm definitely waiting longer after the antibiotics are done to have sex just to make sure everything is alright, but what can I do to not have this happen every time I have sex???!!!