The best prevention for kidney infections is good hygiene.
Most kidney infections start in the bladder
and are from bacteria
that live on the skin of the penis or in the vaginal vault. Women, after intercourse, should urinate within a few hours. Make sure you don't hold your bladder for an absurd about of time since the act of urination
flushes these bacteria from the urethra.
Answer assisted by Garrett Caldwell, Medical Student