There are many different opinions on what would be the "best" home-defense gun. Pistol, revolver, shotgun, carbine—there are pros and cons to each one. Here is a sample checklist of some questions (in no particular order) you need to ask yourself and answer truthfully before you pick the tool that will be used to save your life and defend your family if the need arises:
Can I effectively shoot it with one hand?
Not just make it go bang, but can you be reasonably accurate with it inside your home? You may be using a flashlight or controlling a family member with one hand and have to engage a threat with the other.
How many rounds does it hold?
The highest capacity centerfire revolvers hold eight rounds—many semi-automatics hold 10 to 15 or more with standard-capacity magazines. There is no such thing as "too much ammo" when your life depends on it.
Is it simple to operate?
The revolver is probably the simplest handgun to use. Some semi-automatics have safety and de-cock levers, grip safeties, etc. Some shotguns are more complex to operate (unless you go with a single shot or side-by-side). The most common malfunction encountered in defensive scenarios is that caused by the shooter not properly loading the firearm.
Is it reliable?
How often does it fail to fire during training – this includes not firing because the user did not load it properly or did not dis-engage the safety.
Can I/will I train with it regularly?
The answer starts with the gun being relatively comfortable to shoot (some go so far as to say "enjoyable"). You must also be able to find and afford a steady supply of training ammo, so some of the more esoteric chambering may not be the best choice.
There are other factors, but answering these questions should get you started whether you have several guns to choose from or are looking to invest in a new one.