Please don't get a gun, knife, or even pepperspray. Only frightened people carry an artificial weapon. That means that people who carry an artificial weapon look like easy prey. By the time you can get to your artificial weapon, it's too late, and bringing a gun to a fistfight is a very good way to die. Don't. It's not safe. Guns are nice on range, I guess, which makes them completely useless as a defence tool. Knives are very poor weapons, easy to dodge, and hard to handle. Most people who carry a knife into a fight end up stabbed by their own knife.
A martial art will give you the confidence you need, if you are afraid. Your gait will change, your posture will change, and predators of any kind will leave you alone because of those non-verbal signs. While a weapon reinforces the signs of an easy victim, relying on your own body removes them.
Also, there is simply no better weapon than yourself.
The only problem is: Constantly worrying over being assaulted is probably the best way to actually gét assaulted. It's a self-fulfilling prophecy.
If you want to learn a martial art, there are a few that do very well. I myself have learnt shotokan karate-do, and did some kung-fu. In my opinion: Kung fu is not a martial sport. It is an art, and it's very intense, but in a fight, it isn't worth much. Better options are full-contact karate, tai boxing and gripping/hybrid sports, like judo, ju-jitsu, medieval european fist-fighting, krav macha and stuff like that. Avoid sports that look pretty.

Beautiful martial arts are generally slow, interrupt momentum, and lack impact.