Many people who choose to own a handgun do so for home defense. It's important to remember though that if you're going to keep a handgun for home protection that it has to be; readily available, loaded or easy to load and reliable. If you want a handgun that meets all of these prerequisites then you should buy a revolver.
Some people, particularly those who aren't firearm hobbyists, will turn up their nose at a revolver. The fact that it only has six shots may be seen as a major handicap, and the six shooter brings to mind the Old West, a time when firearm technology was nowhere near what it is today. However the low round capacity is really the only downside of having a revolver, and many of the other advantages more than make up for the relatively small capacity.
First of all, a handgun that you want to defend your home needs to be reliable. There's a reason that so many people carry revolvers in ankle holsters; they're an extremely reliable backup. Revolvers can't jam for instance, unlike a semi-automatic handgun. The mechanism that works a revolver (the spring that turns the cylinder) is also very simple and hard to mess up. Additionally, a revolver doesn't have to be cocked, there's no safety to turn off and there's no worrying about whether it's ready. You just pick it up, point and shoot.
Revolvers also require less maintenance than a semi-automatic handgun. Semi-autos have to be cleaned and oiled from time to time, and the clips need to be changed out otherwise the springs will wear and the gun will jam. Not so for a revolver. Just load the revolver and put it in a drawer near your bed. As soon as you need it your gun is ready to hand. You could leave it in the drawer for years and years, and chances are good that it will fire just as if it was yesterday.
Revolvers are also the workhorses of the handgun family. You can get a caliber as big as you want (you shouldn't go bigger than a .44 Magnum unless you need to protect yourself from bears), or as small as you want (a .38 or .38 Special should do fine for most home defense situations). You should be careful with your caliber because the more power the more recoil, and the more recoil the less accuracy you'll likely have. Additionally, while the goal is to shoot a prowler or home invader, you don't want the bullet to go through the criminal, through your wall, and into your neighbor's home. As such, balance power and accuracy, and if possible use hollow point rounds.
Lastly, practice. If you're a bad shot then it doesn't matter how many bullets you have. If you make the first round count though, then the danger is over and your home is once again safe. Keep the gun cleaned and ready for action, and out of the hands of little ones if you have any. Of course, if you're keeping a handgun for home defense, you'll likely want everyone in the home to know how to use it. Just in case.