I’ve never been offered drugs by anyone in my life and I couldn’t tell you if someone standing on a street-corner is someone simply wanting to cross the street when the lights change or an undercover cop… or an actual prostitute. What am I supposed to be looking for?
(Yes, I’m on-the-spectrum and don’t get invited to parties, so I’m not representative of everyone else’s experience, but I am being sincere in my anecdote)
Going downtown around 1am on a Sunday morning should get you the full package, at least in most European cities. City parks, albeit edgy and dangerous, are an almost sure bet.
Dealers usually ask you if all is fine and you need help with anything, prostitutes clues are usually attitude and attire, plus they often work in groups. A good undercover cop will be unrecognisable, for obvious reasons (they have to copy criminal behaviour to be successful).
Providers have a harder time than their customers (longer jail time and higher fines) hence the secrecy which makes it diffocult to spott them.
When in doubt assume it's not a professional, if they are they will make it obvious.
In reality most people aren’t going to (or rather, shouldn’t try to) seek out drug dealers and prostitutes on the street. For the former it’s more likely someone will “know a guy who knows a guy”, or maybe use the dark web. For the latter there are websites and classifieds, you just need to know the right terminology, etc (from what I’ve gathered, I have no personal experience...)
So yeah, it’s underground, but not that underground.