Dutch pissoirs, which reduce problems with public urination. Some of them even retract into the ground outside peak hours. There are many of these in Germany as well.
This is one of the reasons Northern Europe has the most livable cities in the world — because they are easy to live in. In so many other cities, if you have to take a leak, this begins a desperate search for nearby cafes. The cafe owners are well aware you might just want to piss there, and will be guarding the bathrooms like hawks. Wait staff apparently go through a rigorous training program to detect and deter bathroom walk-ins. Some of the cafe owners decide to profit from the situation, locking their bathrooms (or stationing a beefy Slavic chambermaid in front of the entrance, which amounts to the same thing) and charging you 50 cents.
So what do you do? You do what any normal male human would, you find a secluded spot, and bleed the lizard.
The typical response to public urination outside Northern Europe is camera surveillance, increased police patrols, Draconian penalties, and/or public humiliation. This might be necessary to protect sensitive buildings, but it also applies to even relatively harmless pissing beside a garbage dumpster. There are no public bathrooms even in the areas where people are constantly drinking and walking. The city is designed in such a way as to make it impossible to follow the law, and then, when people predictably don't, the law is made ever more intrusive and coercive. No account is taken of human frailty or weakness.
This is not to say that public urination isn't a problem. Rampant public urination is nasty, unhygienic, and fosters a dangerous sense of social decay. Many states are too disorganized or underfunded to even address a relatively insignificant problem like this, and it shows.
The Dutch, with their pragmatism, simply build human frailty into their calculation. They understand that it's humiliating to citizens and visitors to make them run an obstacle course or fork over money just because they have to pee. This is just another way in which Dutch cities aren't designed to extract the maximum amount of cash and work from the people who live in them, but to actually offer them safe, comfortable, affordable places to work, play, and live. People like getting high and are gonna do it anyway, so in the Netherlands, they can if they want. People like screwing and are gonna do it anyway, so in the Netherlands, they can pay for sex. People are gonna need to pee, so let them do it in comfort and privacy.
It's all so simple, once you think about it.