Exit plans rule.
When I used to live in places that were very racially aggressive, it was the first thing on my mind. I always chose my escape route, kept in mind objects that could be thrown or used for blocking or other defense/offense, took into account my own visibility or isolation and what it might provoke or protect, and situated myself accordingly. Or just turned and left.
Life has seldom been so hard since then, but bad times did teach me valuable lessons. Such as, in the least, don't take the world for granted. The world isn't here for you. It just is what it is. Getting upset about it wouldn't help, of course. But adapting always helps.
Not that you want to "go native," as anthropologists would say. At least not psychologically.
You don't want to embrace chaos and step into its world in any detectable way, because that can become its own magnet for negativity or opportunism from every random malcontent or crazy around. Don't invite people in by appearing to recognize them or share common ground. There is such a thing as being too adaptable. It's usually best to appear a civilian. People don't usually mind them too much. They offer no overt challenge or reward.
Keeping a safe but optimistic distance is one of the key conundrums in life. Go too far on either one and it cancels itself out. Too much safety leads to paranoia, which isolates and leaves one without a social network to depend upon. Too much optimism leads or at least invites evetnual victimhood, which is grim and not safe at all. And will leave one anything but optimistic.
I wish there were one answer for all. But some people are simply going to be singled out for damage and some people are not. For those that don't believe in defending themselves, one hopes that situational awareness will suffice.