Avoiding UTI

How do you avoid an UTI when having sex for the first time? 
I am thinking about having sex with BF for the first time. But, I have read that it is common to get an UTI after sex. I am kind of worried about it. Any suggestions. Thanks. 🤔