score:7
Interesting question, I did a quick Google and it turns out there's an app for that although I've no idea if it's any good.
The general answer is research, wikivoyage will generally point out potential trouble spots in the 'Stay Safe' section, here's part of the one for Athens:
Rough areas
Athenians hold negative perceptions for the areas around Omonoia Square and locals advise you to avoid these areas late at night.
There are many beggars and homeless people who walk around the streets asking for money or food. Often they use children as sympathy tools. Places to avoid are Vathis Square (can be populated by druggies using even at 5 o'clock in the afternoon), the roads on the right of the National Archaeological Museum (almost a gathering place for the beggars of the city - the density is enormous) and the south end of 3 September Street.
The back streets of Piraeus are probably also places where it's unwise to wander around late at night. More recently, Sofokleous Street (a major street south of Omonia), especially the western part near Pireos Street, has gotten a reputation for crime and drugs; some Athenians will advise you to avoid it even during the daytime. Some may also argue that wandering around the Zappeio gardens and the Pedion Areos parks at night time may not be wise.
That also gives the best clue as to how to find out more -- ask a local. If you're staying with locals you can ask them, otherwise taxi drivers are a great source of information if they speak your language, also bartenders. The concierge at any decent hotel can help (if you're polite, and tip if appropriate, you probably don't even need to be staying there). Also check out if you have access to a 'virtual concierge' with your credit card, they can find out for you too.
Failing all of that, use common sense. Avoid poorly lit areas with little foot traffic, beware of people randomly hanging around, try and stick where there are other tourists -- or at least business people or families. Although beware of criminals hanging around in tourist areas to pick on tourists.
There are plenty of other threads on staying safe while abroad.
If your questions was not about finding the areas but avoiding them, well there's no real difference. First you have to know where they are. There's probably no reason you'd have to go to an area like that but if you do I'd recommend not going alone, if you're going to specific place take a taxi and arrange to have one pick you up (or a hotel car, etc).
Finally, listen to your instincts -- if something feels 'off' then leave the area.
Here's an interesting reddit thread that I lifted some of the above from, although it's mostly common sense.