I have given this topic a lot of thought over time. Since I don't know your circumstances or how good a shot you are, I can't give a recommendation. I can only tell you what I do and why.
For home defense, I have a 12 gauge pump loaded with duck loads of steel BBs next to the bed. It seems to be a nice compromise between buckshot and light pellets. Nothing else to recommend that size other than my choice.
I also have a 9mm loaded with 124 grain hollow points with an extra mag. The reason for this is, if the bad guy gets behind family member, I want something more precise than a shotgun. If the bad guy gives me an eyeball or more to shoot at across my house, that will be all I need. I am not a superb shot but at close range I am good enough. I don't worry about over penetration since the closest house is over 100 yards away.
There are other handguns stashed in appropriate places in the house where I tend to spend time.
For carry outside, I have a number of choices that range from an XD-E in 9mm to a S&W model 60 which I carry with 38 special 125 grain hollow points as well as a couple of larger size handguns. I use these because I can shoot them accurately and I shoot them often enough that I don't have to think about what to do to make them work.
For carry when hunting, I have a 686 with a 6 inch barrel. It is usually loaded with 158 grain soft nose depending in part on where I am. The biggest threat where I go hunting are packs of dogs and coyotes. There is an occasional cougar around but you never see them.
All my semi-auto pistols use the same manual of arms. I don't want to have to think about which pistol I am using that day. That is why I went with Taurus PT92 instead of a Beretta 92FS.
I have a couple of 22 pistols for target shooting that work differently but they will never be used for defense.
This is what I have chosen because of my circumstances. You will need to decide what works for you in your circumstances.