You have to meet the level of threat.
Avoid threat= don't go there
Prevent threat= blinkie lights, good locks/illumination
Meet threat 1. Wasp spray/bear spray
2. Blunt object, baseball bat etc.
3. Edged weapon
4. Fire arm
You need training to use weapons, edged and firearm. You can get in trouble and end up dead or in jail defending yourself. TRUST ME ON THIS. If you are dead set on a firearm, I suggest a shot gun. 12ga rounds come in non-lethal to hull
protection is not available, situational awareness is your best defense.