This is actually very common and called "shy bladder".
You're not going to be able to 'not think about it', but you can choose to think another thought that makes you feel more comfortable. Our minds are pretty easily tricked, if not re-trainable.
1. When you urinate at home, think of how good it feels and come up with a word or mental picture that represents that feeling. Sit with it for a sec and let it sink in till you feel the warmth of the thought. Do this every time you urinate at home. You're trying to re-train your connection of urinating with a positive experience.
2. After a few weeks of this, choose a bathroom that you're most comfortable with, walk in there and conjure up your happy thought. Walk out and leave. Do this till the good thought automatically comes to your head when you enter the bathroom.
3. Once you're set and comfortable with steps 1 & 2, go in there and urinate. Force your mind on the happy though each and every time it tries to go to anxiety
. Do it like an OCD maniac and replace the fear as soon as possible. Keep at this till you can go in that bathroom.
4. Pick another bathroom and repeat 2 & 3. Pick another one.
5. By this time, you should be able to go into a random one.
It's standard behavior mod, but it works!
If you would, please fill out the feedback form after accepting. I appreciate this opportunity to help you out today. If I can be of further service to you, just put "for Anna" in the front of your new question, and I'll be the one to answer it.