What Each One Does
A GFCI — ground-fault circuit interrupter — monitors the current flowing out on the hot wire against the current returning on the neutral. When those two numbers diverge by as little as 5 milliamps, the device trips in a fraction of a second. That tiny imbalance means current is taking an unintended path, most likely through a person. GFCIs stop electrocution. You'll find them as outlets (the familiar rectangular test/reset face) or as breakers; either form protects everything downstream.
An AFCI — arc-fault circuit interrupter — solves a different problem entirely. It listens electronically for the electrical "signature" of a dangerous arc: the erratic current pattern produced when electricity jumps across a damaged wire, a nick in insulation, or a loose connection. Arcs generate intense heat without tripping a standard breaker, because the current involved may never exceed the breaker's rating. AFCIs are almost always breakers rather than outlets, and they're aimed squarely at preventing house fires.

Where Each Is Required
The National Electrical Code sets the boundaries, and both requirements have expanded over successive code cycles. As a rule of thumb:
GFCIs are required wherever water and electricity share close quarters — bathrooms, kitchens (countertop receptacles), garages, outdoors, crawl spaces, unfinished basements, and near swimming pools. The logic is consistent: proximity to water raises shock risk.
AFCIs are required on most bedroom circuits, and in recent NEC editions they've expanded to cover nearly all living spaces — living rooms, hallways, dining rooms, and more. Because bedrooms are where people sleep through early warning signs of a wiring fire, that's where the requirement started.
Where you need both: Some locations fall under both rules — a bedroom with an attached bathroom, for instance, or a finished basement. In those cases you need a dual-function AFCI/GFCI breaker, which is exactly what it sounds like: a single breaker that watches for both hazards simultaneously.
How to Tell Which You Have
Look at the breaker in your panel. A standard breaker has a simple toggle. An AFCI breaker adds a test button; so does a GFCI breaker — but the label on the face tells you which type it is. A dual-function breaker will be labeled "AFCI/GFCI" or "DF." At the outlet, only GFCIs come in receptacle form (the test/reset buttons); AFCI protection is most often a breaker, though AFCI outlets do exist for certain situations.
If your home was built or substantially rewired before these requirements applied, you may be missing one or both protections. Adding GFCI outlets is straightforward DIY. Replacing breakers — especially adding AFCI or dual-function types — means working inside the panel, which is a job for a licensed electrician.
Anything inside the panel, a new circuit, or a fault you can't explain belongs to a licensed electrician — there's no shame in making the call.
Referenced throughout: National Electrical Code (NEC) — the model code adopted by most US jurisdictions.