A urinary tract infection develops when bacteria get into your urethra, so personal hygiene is important in preventing infection. That doesn’t mean you have poor personal hygiene if you get a UTI, though – having sex is also a frequent cause because bacteria from your partner’s genitals, fingers, or mouth can enter your urethra.
Urinary tract infections typically affect women more than men because it’s easier for bacteria to access the female urethra. UTIs are also more likely to affect older people, those who have diabetes, and people who are obese.
Not drinking enough water is also a risk factor.
If something is blocking the flow of urine from your bladder, that can increase your risk of infection too. Examples include stones in your ureters, bladder, or kidneys, and abnormalities in your urinary tract.