We've all got to use public restrooms. Nobody likes it, but it's a fact of being human.
Some people find it difficult or impossible to urinate in the presence of others, in public facilities, or even in their own homes. Some people can't pee if there is pressure about time, if other people are present and might hear them, or if others are waiting for them to go, or if traveling in moving vehicles.
I've heard it called bathroom "stage fright," or shy bladder. But it's actually a social anxiety disorder called paruresis.
7% of the public (about 17 million) people suffer from having a bashful bladder. If you can relate to this - find a support group or therapist. They can offer helpful solutions so the next time you go to the bathroom in public you'll be able to go.