Get a good pistol with night sights that does NOT have an external safety. I'm not a Glock fanboy, but a Glock 19 is an excellent gun for a first time owner. Easy to use, easy to handle, easy to breakdown and reassemble, reliable, and if you handle it correctly and use good ammo, your odds of having a failure in a crucial situation are about the same as your odds of getting hit by lightening. My nightstand gun is a Glock.
And **** revolvers. 15 rounds much better than 6. Heavy double action trigger pull which can make you more likely to miss. You can cock the hammer to get a single action pull, but if you do, and then need to uncock it because the burglar alarm went off because a door wasn't shut quite right, while it's loaded and you're half awake, heart pounding and ears ringing, your thumb might slip off the hammer while you have the trigger depressed and you just might have a negligent discharge in your house. And really regret telling people about it later.
Trust me on this.
1911s are kind of next level guns. Harder to disassemble and maintain,
and they all have external safeties that you will likely forget to disengage in a crisis situation. I won't carry one and, and my 1911s all live in my safe.
Shotguns are effective, but bulky and harder to manipulate, especially if you're a novice fumbling around in the dark. Again you have the external safety issue. Same goes with ARs or similar rifles.
Get a Glock 19, and for home load it with good defensive rounds. Learn how to use it and maintain it. Take a class. Practice using it until you can reliably hit what you're aiming at.
And remember, merely owning a gun isn't enough; it's a tool, not a talisman against evil. You have to be prepared to use it, and use it correctly.