Being alert is for sure at least half of the battle. And the best battles are the ones not fought, because of measures taken—beginning with a 360* mindset. Even on long walks, stop and look around frequently. Loop back, change sides of streets, turn around frequently, and see trouble while it’s still at a manageable distance.
And if they still come on to attack, at least you may be ready with your trusty revolver or pistol. But it all starts with honing situational awareness and scanning 360* frequently.