Any way to prevent utis before that occur?

Yes. Urinate after sex to eliminate bacteria reaching bladder during. Spread thighs widely when urinating & wipe front to back. Avoid or treat constipation. Cotton panties & no thongs. Shower rather than bathe & no bubble baths. Keep hydrated and avoid delaying urination. Cranberry juice, gelcaps or tabs can help to avoid bacteria adhering to bladder lining. Avoid xs caffeine or acid producing beverages.