Like cars, there is no "one size fits all" gun, but here are some tradeoffs to consider:
For handguns, the smaller, lighter ones are easier to carry and conceal, but they are generally less effective due to using smaller (weaker) calibers and holding fewer rounds. The larger ones utilize more powerful and effective calibers, but are bulkier and heavier. I would avoid any caliber smaller/weaker than a 380, or stronger than 10mm, unless you anticipate dealing with bears or druggies. 357s can fire 38 special ammunition, and are a great revolver choice. 9mm is a good general auto choice, but a 45 packs more punch without being too strong.
The 12-ga. shotgun advice is good, with one caution: aim is important. A 00 buckshot load will only spread out a few inches at 25 feet, so you must be on target with your aim. 00 buck is good with no over-penetration, but a slug will pack a greater punch (bears or druggies) if there's no innocent people behind the bad guy. If the bad guy may be wearing body armor, consider a rifle (223, 30-30 or 30.06). Even then, some body armor may stop these, so consider head shots too.
Just for perspective, I got my wife her first gun, a 5-shot 38 special in 1986, and she still carries it. She wants to switch to a 45 that her dad gave her, since it carries more rounds and more impact.