Drinking plenty of fluids, practicing safer sexual hygiene, consuming vitamin C-rich foods such as oranges, strawberries, tomatoes, and broccoli, and taking probiotics are some ways to help prevent a UTI.