Your vet should analyze your dog's urine to see if it has any crystals in it and what the pH is. With any kind of bladder stones or UTI it's extremely important to get dog to drink alot .
If urine contains struvite crystals and alkaline pH (these are the type of bladder stones usually associated with UTIs) you feed your pet a low-carb,high protein, grain-free, potato-free, and preferably raw, dehydrated raw or at least canned food diet for the increased moisture content.
eg. Real Meat air dried beef ( only 27% carbs ), Stella and Chewys Simple venison ( only 13% carbs ), Nature's Variety Instinct Raw Market nuggets beef ( only 16% carbs ).
Honest Kitchen Embark has 41% carbs in comparison.
You need urine pH to be below 7, optimally between 6-6.5 which you can check with a pH meter once a week or more frequent that you dip into the urine. eg.
https://www.amazon.com/HiTech-Digita...ustomerReviews , If pH is too high even after switching diets you can add Methioform, or Petmeth supplement.
If it's cystine crystals you would need to neuter him if he isn't already.
If it's oxalate stones you have opposite problem, urine is too acidic, so you need to give potassium citrate to alkalinize urine
You should also feed a good probiotic like Herbsmith Microflora Plus or Proviable DC.
It's also helpful to give d-mannose powder to prevent further E.Coli urinary tract infections.