There are 3 general categories of firearms: handguns, shotguns, and rifles. Many other firearms defy classifcation into these 3 basic categories, but we can worry about those special guns later. (There are special categories for most of those other guns, but some guns still defy classification.)
Shotguns: These are designed to be held with both hands and pressed against the shoulder for stability & recoil control. The barrel is usually smooth on the inside, but special versions may have spiral grooves called “rifling”. They fire a “shell” loaded with many small pellets. The pellets spread out into a pattern. The pellets come in a variety of different sizes for different purposes. Shotgun shells are measured by “gauge” which is an old system based on the weight of a lead ball. For example, imagine a lead ball that weighs 1/12 of a pound (12 balls = 1 pound). That ball is a 12ga ball. Common shotguns sizes in common use are 12 gauge, 20 gauge, 28 gauge, and 410 CALIBER. Yes, that’s right, 410 shotguns are a caliber, not a gauge. 12 gauge is the most common and most powerful. 20 gauge is popular because it kicks less than 12ga but they suffer from limited ammunition choices. 410 is very small and is mainly used for small-game hunting and children’s shotguns. 28 gauge is uncommon and mainly used by target shooters. 16 gauge was common a long time ago, but it is very rare now. As a final note, the “spread” of shotgun pellets is greatly exagerated in movies & video games. At typical self-defense range, the spread is less that 1 foot across. Unfortunately, I don’t have any shotgun experience, so I’m going to skip discussion of shotguns except for home defense.
Rifles: These are designed to be held with both hands and pressed against the shoulder for stability & recoil control. The barrel has grooves on the inside (called “rifling”) to make the projectile spin. A spinning projectile is more stable, and hence more accurate. Some bad authors have claimed that the spinning bullet somehow makes the gun more deadly or powerful. No, but without a spinning bullet, it would be difficult (almost impossible) to hit a target past 100 feet. Rifles are capable of using an extremely wide variety of ammo, depending on the rifle’s design & purpose. Generally speaking, a rifle is more accurate and more powerful than a handgun. Of course, it’s not fair to intentionally compare a high-power handgun to a low-power rifle. Rifles are superior to handguns in every way, except for what they weigh (bad pun). Handguns are smaller & lighter than rifles, which makes them more convenient to carry & transport. A typical handgun is around 2 pounds, while typical rifles range from 5 pounds (ultralight) to 10 pounds (very heavy).
Handguns: These are technically designed to be held in 1 hand, but no one actually recommends a 1-handed hold unless necessary. They have rifled barrels for superior accuracy than a smooth barrel. Handguns are the most common choice for self-defense, and the most common choice for crime. A small handgun is easy to carry in a pocket for defense. A full-size handgun easily slips into a handbag, backpack, car glovebox, or bedside nightstand. Full-size handguns are generally more accurate and powerful than smaller handguns, but not always. Handguns are usually revolvers or semi-auto pistols, but other designs do exist.
I’m mainly discussing common designs & features, but remember that people have been building guns for centuries, and the current era of firearm technology started in the 1860’s with the invention of self-contained metallic cartridges. These enabled the creation of semi-automatic and fully-automatic firearms starting in the 1880s and 1890s. Since then, nearly all firearm research & design work has focused on perfecting the basic concepts that were pioneered 100 years ago. In between, gun designers have experiented with some pretty crazy, weird, and exotic ideas. As a result, there is an exception for every general rule.