First things first... the "using a gun for self-defense rules" don't even matter unless you are of the sheepdog mindset, you know what having a deadly weapon is for, you know how and when you to use it, and you are willing to use it to take another person's life... which is no small undertaking... even if they are a dirty scumbag. Guns used for self-defense ain't for scaring people off (although it happens), they're for shooting people... people who are threatening you with serious bodily harm or death. If you've got that in your psyche, then consider these rules...
Using a Gun for Self-Defense Rules:
Rule 1: Have a gun (as in with you or ready at hand).
Rule 2: Have a reliable gun you can reliably shoot.
Rule 3: Be a life-long learner and shooter so you can decide about Rule 1 and Rule 2.
Rule 1 was basically covered in a previous Sheepdog 101 post, so an introduction to Rule 2 and Rule 3 is probably overdue. A reliable gun is one that goes bang pretty much every time it is supposed to and doesn't go bang when it is not supposed to when combined with YOU, the shooter. What works for someone else may or may not work for you. Being able to reliably shoot a particular gun means that you can comfortably and reliably operate that gun to place bullets on intended targets in the intended places any time the need arises.
Now which gun fits into these rules for you is something you will need to learn about and decide. Too often I have students show up at a basic pistol, rifle, or shotgun course with guns that were selected for them rather than guns they selected. That might work when you're first starting out, but try as many guns out as you can, educate yourself, and make your own decisions.
A shotgun is hard to conceal, but might make a good home defense firearm. Need to shoot at a significant distance, a rifle is always better than a handgun and even works in close-quarters, but again... difficult to conceal outside the home.
The .45ACP vs 9mm debate has been raging for years, but it doesn't matter. But the big ol' 45 will make rapists do double back-flips when hit while the little niner will just annoy them... maybe you should also consider that my Ruger SR9 carries eighteen rounds with one in the chamber verses my SR1911 that carries nine rounds with one in the chamber before a reload occurs... stopping power vs. firepower.
Now I'm not advocating one over the other... those are questions YOU need to learn about and decide. Some people recommend you use or carry the largest caliber gun you can reliably shoot, but I don't always buy that the diameter of the bore is the prime factor you should consider in selecting a gun for self-defense.
Revolvers are old school, don't waste your time... and they only hold five or six shots... now wait a minute there folks... I do still recommend revolvers, but each recommendation is based on the person and their need for a reliable gun they can reliably shoot. Revolvers just seem simpler to some people and if that is what works best for them, then that is the best choice.
The .22 is worthless and isn't lethal enough... maybe, but I wouldn't ask Robert F. Kennedy's opinion on that one. No, I'm not endorsing the terrific little .22 as the defensive round of choice, but as I tell my students... a .22 shot placed on-target is better than .45 shot that misses the target. The two considerations that make .22s a possibility for self-defense is that they are usually inexpensive to purchase and shoot, and they're easy to shoot reliably so folks will likely practice more often.
So how do you know which gun is best for Rule 2... follow Rule 3. Take an NRA Basic Firearm training class, go to a gun dealer and ask questions, try out a local range and rent some guns to try out, join or visit a shooting sports or gun club... many folks in a lot of clubs enjoy showing new folks their guns and even letting them try a few out. You'll meet a lot of good, like-minded folks... and an occasional idiot or two... so learn to sort the wheat from the chaff for yourself.
Plans fail for lack of counsel, but with many advisers they succeed.
There are a lot of good and bad opinions and information out there about guns and the best thing anyone can do is educate themselves, practice regularly, and... bring enough gun... for you.