Preventive measures include adequate hydration, regular urination, and proper genital hygiene. Women should also avoid irritants like caffeine and spicy foods. Cranberry juice is often recommended for its potential to prevent UTIs, though evidence is mixed.