
Avoid attacks by thinking about what's going on in your surroundings.
Learn to read people's behaviour; this can help you to avoid confrontation.
Don't daydream or have your head down into your mobile phone, ignorant to your surroundings while walking through the streets.
Consider this, You can't keep aware and alert all the time, it's a part of being human and humans get distracted, But the more you learn about your awareness and build on your consciousness in the streets, the better you become in seeing things you would of never seen before.