I have several guns, but now that I am older I seldom fire them. I have two hand guns a .22 automatic that fires long rifle cartridges and I have a .44 magnum revolver. I keep them loaded and in easy reach should someone break in. But where I live, that is highly unlikely to happen. Still, it could happen.
If you feel there is a danger of a break-in at your home, then I would get a hand gun. But if you do that I would strongly urge you to take a gun safety course. Buying a gun is one thing, knowing how to handle it safely and how to use it effectively is quite another. And always remember, if you pull the trigger, there may very well be unpleasant consequences.