The cause of most UTIs is bacteria that initially settle (colonise) around the urethra (urine tube), and then ascend into the rest of the
urinary tract.
Factors that can cause this to happen include incomplete
urinary emptying, hygiene of the urethra, prostate inflammation, urethra narrowing, bladder reflux disease (usually due to leaky valves between the bladder and ureter tubes that connect to the kidneys and diabetes etc.
It is better to get a urine examination and urine culture done.