You get super paranoid. I've lived in Rio de Janeiro all my life, and I've never heard of anyone who either was never mugged or had someone very close that was (by someone close, I mean spouse, parent or child).
I've seen three people being mugged in front of my place, and I don't live in a place locals would call "dangerous".
But that's just me. Besides some common practices that have become instinct, like not using your phone outside and looking over your shoulder in desert places (or avoiding these places altogether), I think the majority of the population got numb to this situation and just accepted it like it is normal.