I'm a Certified Range Safety Officer, and Club Level Handgun instructor up here in Canada. The best advice I can give someone new to shooting is that guns are only effective if you can hit what you aim at.
Since you are new to guns, let's not get distracted with discussions about different types of ammo, and everyone's personal preference, but stay focused on what your own needs are. In order to use any gun effectively and safely, some instruction is a great place to start.
Likewise, to build confidence and the accuracy you need to be effective, there is no substitute for lots of practice. Best way to do that is with something that is affordable to shoot, so you shoot lots. First choice for me would be .22. I learned to shoot with a single shot .22 rifle (which I got from my dad, which he got from his great uncle). My first pistol was a surplus Webley Enfield in .38 S&W (similar to 9mm in power); second one was a .22 semi auto. I have owned it for over 40 years, and I still win competitions with it LOL.
Go to a range where you can try different guns; buy a .22 that you like feel of, join a club. Most club members will be glad to let you handle and even shoot a bunch of different guns.
For me, I prefer the classic high standard .22 pistol, for practice and competition. I shoot Police Pistol Combat with a 1911 .45, an all steel Jericho .40 S & W and a CZ pattern 9mm, and more recently a Ruger GP100 .357 Magnum through which I shoot only .38 special target loads (I have yet to shoot magnum loads in it, and the gun has never seen a factory load since new).
That brings me to my next point.
If you are looking for a defensive pistol, you don't need "elephant gun" power with arm busting recoil. Remember, a well placed shot from a target load will be far more effective than a miss with a super-magnum. Less recoil also means easier to get off a second, third.... "accurate" shot.
Rifles
Again a good .22. There are lots, and they are a lot of fun. Me, I shoot mostly CZs; I have two CZ 455s, one in .22 another in 17 HMR (for ground hogs), I have one other CZ 452 (Brno 2) in .22. It is my "open sight" competition rifle; and it has one of the prettiest pieces of walnut on it I have ever seen!!.
Determine your needs; if you hunt big or medium sized game, you will need heavier calibers.
I have lots of others, different calibers, different actions just because I like them, and they are fun to shoot.