Vitamin C can help treat a UTI by increasing the acidity of urine, which can inhibit bacterial growth. Consuming foods high in vitamin C, such as oranges, strawberries, and bell peppers, or taking supplements can be beneficial in managing UTIs.