M9
The Beretta M9 is a good pistol. It is almost exactly a functional copy of the German Walther P-38 that was made in vast quantities during WWII, so it should be good (all the bugs worked out decades ago).
.40 S&W is a better choice than 9mm. More power per round vs. more rounds is your choice.
A handgun is a Personal Defense Weapon (PDW). The emphasis is on personal. If it works for you, go for it. The Beretta M9 is a proven, reliable design.
My choice is a Colt M1911 (mostly because it's about the only pistol I can tolerate for more than a few minutes in a IWB holster), but that's personal preference.