There is actually no good evidence at all that cranberry juice can treat or prevent urinary tract infections. However, there is theoretical evidence that it can prevent the adhesion of bacteria to the lining of the bladder, which makes it plausible that it could help.
I think this is a good example of a time when there is very little downside to using a natural product. Anecdotally, some people feel that cranberry juice helps them. I don’t argue with success, especially if the intervention is so low risk and the cost is not a barrier.
Just beware of a few issues: Cranberry juice is acidic, so if you have acid reflux you may want to stay away. It also contains a large amount of sugar, which should be avoided generally but especially if you are diabetic. As an alternative, cranberry extracts do not contain glucose, so they are another option that you could try safely.
Explore more expert advice.