You don't. You go to the doctor and get treated. I have had more than my fair share and when they weren't treated properly they just got worse. They can travel up your urinary tract and infect your kidneys. That means being hospitalized. Just go and get it treated right from the start.
UTI's are usually treated with antibiotics because they can lead to kidney infection. You could try some of the over the counter cystitis powders, asparagus, and coconut. If you are going to drink cranberry juice make sure it contains cranberries. Usually cranberry juice is used to prevent water infection, sometimes the acid can irritate the bladder. Drink plenty of water. It is best to see your doctor then he/she can test your urine. A kidney infection could land you in hospital.
If it is actually an infection .. Then no .. You don't 'treat' in with a home remedy. You will need an antibiotic. An infection is far easier to treat in it's early stages than it's later stages .. For obvious reasons.
I've had some relief by drinking apple cider vinegar but if it's really an infection then you need antibiotics and fast before it ends up being a kidney infection.
Drink lots of cranberry juice. I read that it is rich in vitamin C and antioxidants, and also has antimicrobial qualities, which makes it especially effective in combating urinary-tract infections.” But this is not due to the juice’s effect on urine acidity, as was previously thought. Rather, says The Times, it stems from substances in the juice that “prevent the E. Coli bacteria [the cause of most infections, including cystitis] from sticking to the urinary-tract wall, so that the bacteria are flushed away before an infection can become established.” Good health to you! :)