how can i prevent urinary tract infections?

I keep getting urinary tract infections. The doctor gives me anti biotics for it, but as soon as. The prescription is gone, it seems another one is there but worse, with lots of blood and blood clots. What can I do to try and prevent these?