While any kind of gun will be good to have, some are going to be better than others depending on the situation. Here are several guns that you can reliably count on when SHTF. (Related: Self defense is a 'Divine Right' says Mike Adams in new video documentary.)
For a good handgun, you need something that is very reliable, easy to use and repair, and is small enough to hide if the situation warrants it. That's why one of the best handguns to have around would be the Glock 19. It's a great all-around pistol that can withstand a level of abuse and it has great stopping power. Many members of the law enforcement community use the Glock 19 or one of its variants, which means that its 9x19mm Parabellum round will not be in short supply. Plus, the versatility of the Glock platform means that it's easily customizable for any situation: You can switch out its default 17-round magazine for a 31-round one; you can strap a flashlight under the barrel; and you can even go out to get a conversion kit and turn your Glock into a sub-machine gun.
The shotgun is a simple, sustainable weapon with powerful potential. It can take down big game and stop an attacker dead in their tracks. For one of the best out there, look no further than the Mossberg family of shotguns. These are robust shotguns that are easy to maintain in a survival scenario. Specifically, you want to look for the Mossberg 590. This gun was designed for the military but has found itself in use for sporting. Almost no assembly will be required when you buy it, it's very easy to use thanks to its simple operating mechanism, and it even has a bayonet lug that you can attach a knife to if you think you have to defend yourself in close quarters.
If you want one gun that can work for almost any kind of situation, then go for a magazine-fed semi-automatic or select-fire rifle. The two best guns of that kind you should consider are an AR-15 variant or a Kalashnikov rifle, most likely an AK-47 or an AKM. Both are durable, can take a high amount of abuse, and they both perform very well. Both cartridges, the 5.56mm and the 7.62x39mm, will pack quite a punch; however, the former is more widely available due to its widespread use in the U.S. If you have to choose between the two, while an AK will be slightly more powerful, an AR-15 variant is the preferable option. Its accuracy is far more reliable and it will be easier to maintain due to the availability of parts.
At the end of the day, the best gun for you is the one you're most comfortable with, and one that fits your own situation. Whether it be a handgun, a shotgun, or a semi-automatic, if you believe it's the gun that you feel the most safe with keeping around, then you're good to go. The most important thing is that you're prepared when SHTF, and with any of the guns listed above, chances are that you will be.