It's about the software, not not hardware.
1. Choose a reliable gun that fits you, not you to it. Reliability is the singularly most important aspect of any weapon.
2. Choose the gun in the caliber it was originally designed for. Like with the Glock, the 9mm is the most reliable versions, of each size Glock makes.
3. Learn your gun. How to do ALL maintenance, down to the smallest part. Clean it EVERY TIME YOU USE IT. EVERY TIME. Learn how to take that Glock, 1911, SIG, HK, Beretta etc... all the way down, for inspection and maintenance. Change your springs on the manufacturers schedule, not yours. There is a reason they made the schedule they have. (no selling more parts is not it.) (also stock extra parts, springs, pins, firing pins, levers and such.)
3. Get quality training, as much as your time and wallet can afford. Then get some more. Frankly one could say you literally cannot get enough. But one must be practical. None is not a good option.
4. Quality practice. That ain't what you do when you go to your local range and stand there and shoot. Get lots of quality practice.
Listen to folks that have actually been in and won gunfights. Not in the movies, TV or on the web. Shooting a weapon is not like competing with a weapon or hunting and none of them are like fighting a weapon. Fighting a weapon against folks who shoot back trying to kill you, and refuse to or will not die for you, is an adventure that I do not recommend.
After all of that, if caliber is still the question, you really don't understand the problem.
Once again, it's software, over hardware. Spend your money, which you can always choose to get more of, and particularly your time, wisely.
Go figure.
Fred