GFCI: shock protection
A ground-fault circuit interrupter compares current going out and coming back. If some is leaking, possibly through a person, it cuts power in a fraction of a second. Required near water: kitchens, baths, garages, basements, outdoors.
AFCI: fire protection
An arc-fault circuit interrupter detects the electrical signature of arcing from damaged wires or loose connections and shuts the circuit off before heat builds. Modern code requires it across most living areas.
Outlet or breaker?
Both types come as receptacles or breakers. Outlets are handy for adding protection at one location; breakers protect the whole circuit. See GFCI outlet installation and AFCI breaker installation.
Older homes
You are generally not required to retrofit, but it is among the most cost-effective safety upgrades. A residential electrician can add protection in an afternoon.