Most people growing up in the lower-to-middle class NYC neighborhoods like I did learn that at an early age - sometimes the hard way. I was mugged near my home in Brooklyn when I was about 11 years old. Luckily for me, they just took my portable radio and ran. Good lesson though.
Even in areas considered nice, it’s better to maintain situational awareness.