Well, first of all, you always want to steer clear of any oil-based lube. Oil-based lube can cause vaginal infections, and it can break down condoms, but lest I digress. Though men can indeed contract a UTI, it's not very common, so I'm guessing that you are a female. So that leaves you with either water-based or silicone-based lube.
Whether you choose to use water or silicone-based is a matter of personal preference there. What you do want to watch out for is spermicide. Studies have shown that spermicide can increase some women's chances of contracting a UTI.
There are, however, other things that you can do to decrease your risk of contracting a UTI as well. Personal hygiene is always important.
We can debate about whether cleanliness is truly next to godliness, but what's not debatable is that cleanliness will decrease your chances of contracting a UTI. One surprising factor that can increase the chances of a UTI is holding your urine in.
Now, we have all been in situations where you can't just pee whenever you feel like it. The only thing I can say about that is to avoid those situations as much as possible. Not only is holding your pee uncomfortable at the time, but it can also lead to more discomfort if you contract a UTI.
Some other factors can also increase your chances of contracting a UTI less out of your control. Many people like to blame mom and dad for their problems, but genetics can play a part in how susceptible you are to getting UTIs. So can diabetes. And so can getting older. Ahh, the joys of getting older: you lose hair where you want it, grow hair where you don't, and your estrogen level decreases.
A decrease in estrogen can also increase your chances of contracting a UTI. So, to sum up, the easiest things to do are to avoid spermicide, stay clean, and pee when you have to. If UTIs continue to be a major problem for you, of course, you should always visit your doctor.
Most of us prefer not to be poked and prodded down there, at least in a doctor's office anyways, but never leave any medical issue untended for too long.