First off, drugs are the least of your worries in such an environment. You should be about as affraid of a drug dealer as you are of a guy who runs a hotdog stand. You should be as affraid of a drug addict as you are of a guy who really wants to eat a hotdog. Drugs are a product for sale and consumption, nothing more.
If some random dude asks you what you need, and you don't need any drugs, tell him nothing. I have yet to see a drug dealer cram drugs down the throat of a passerby. The whole pusher thing seems to either be b.s. or based on something that happened long, long ago. If someone asks to borrow a dime or a nickle or somesuch, tell him you don't have anything or you're clean or something to the effect.
You only run into problems with "drug people" when you are somehow involved in the business, as a supplier or purchaser. Don't buy drugs, don't sell drugs, and you've got little to worry about. If you do feel like buying drugs, buy from a middle aged or older dealer. He is there to make a living. He might try to rip you off, sell you some bad product, gouge prices, or any thing like that, but you are fairly assured of walking away alive and unmolested. DO NOT try to buy drugs off anyone under 25, especialy if "they be thug'n" or trying to look like a "gangsta" or whatever it is they like to say these days. We all watch tv, you know what the type looks like. Those are the ones you have to worry about, because they are wrapped up in the image, they are idolizing criminal behaviour, and they will turn on you. Every time.
The druggies themselves, well, it is like drunks. Some are angry when intoxicated, others are completely mellowed out. Some will break into your car, others will sell handjobs for cash or something. Very few will violently confront you. They want some money or something they can trade for drugs, not a fight. Quite a few think it is okay to steal from a business or rich person, but wrong to steal from a regular sort of person. That last goes for most people down there.
If you don't match the ethnic background, or it is obvious you have no business down there, do not make eye contact with anyone. Pretend you don't notice them, even if it means staring at a fixed point in space or looking away from them. If you stare, they will come interact with you. Maybe they will try to sell you drugs, maybe they will just come and put a hurt'n on you. Either way, you basicaly want to just pass through like you never were there, so don't say anything, don't look at anyone. Try not to look like you could possibly be affiliated with a gang in any way. Gangs tend to be most violent towards other gang members, rather than just random strangers.
Sometimes it can suck to be of the same ethnic background as the local populace. I hear quite a number of fellows in the various places I periodicaly find myself commenting on a rape case that made it to the newspaper that "I know better than to take p*ssy from a white woman/b*tch".
If walking on foot, occasionaly you will find a local denizen who will follow you, or lead you, but without any intent to do you harm. He is your escort. He may or may not say something like "you don't belong here", but it is in the "you better find a way out quick before some nasty fellow takes exception to you!" way, not the "I'm gonna beat you down" way. Generaly speaking, don't be too alarmed.
Sometimes you will pass by a gaggle of rough looking sorts, and they will send a representative out to talk to you. He will usualy say something along the lines of "those guys over there want to beat your @ss, but I don't so I am trying to cool them off". He will then usualy ask for you to give him your wallet, your bags, your hat, something of that nature. Usualy you can talk him out of it. But, always keep walking. That way if it does come to blows, at least there is some distance between himself and his allies. Oddly enough, this one has never gone sour for me. I don't know what exactly the deal is, though it happens all the time. I am not sure if the representative really doesn't want anything to happen, or if I am just lucky. Who knows?
"The streets" aren't such a terribly lethal place, actualy. On any given day, you have a really good chance of going about your business without any troubles. Any given night, too. And in any given neighborhood. Oh, sure, you'll get all sorts of people telling you how "hard" their life back in "the `hood" was, and then they'll say they are from some infamous district in some notorious city. It is all pretty much B.S., and don't believe otherwise. If you mind your own business and don't get involved with drugs and gangs, your chances are really good.
Also, as they say, when it's on, it's on. Once someone gets in your face, there will be violence. At that stage there is no talking your way out of it or running away. That is basicaly how the badguys get themselves psyched up and impress their friends. Well, that isn't entirely true. You can talk your way out of that situation, and then think you got madd urban survival skillz, but in reality it was a B.S. situation to begin with and you were in no real danger. Anyway, your best bet when someone gets in your face is to attack immediately and in a devestating manor. And be prepared to fight ten of his largest friends at the same time. Yeah, that part sucks.
Hmm... there is way too much to say to be able to put it all down in a thread. The main point is, 9/10ths of what you here about "today's violent urban environment" is utter cr@p. Just a way to promote a martial fantasy or sell products. It is very survivable. Countless people live their whole lives in such an environment with few to no bad experiences. Stay away from trouble, and trouble stays away from you.
Of course, that assumes you aren't a total dumb@ss without a single ounce of common sense about you. As soon as you start doing the "I'm not prejudiced!" and "I don't judge books by their cover!" and "Love thy neighbor" thing, you're basicaly screwed. Remember, don't talk to anyone, and if you have to say something, say it is simple words easily understood by anyone and in a way that clearly conveys your intentions. And don't make eye contact.
Now that I think about it, the street is a lot like Microsoft Windows. Especialy Windows 95 release A. Weird.