People mix these two up constantly, and the difference actually matters. A GFCI watches for current leaking off the circuit to ground, the kind of leak that runs through a person standing at a wet sink. It cuts power in a fraction of a second to prevent a shock. That’s why code puts them in kitchens, bathrooms, garages, basements, and outdoor locations, anywhere water and electricity share space.
An AFCI does a different job. It listens for the erratic signature of arcing inside damaged wiring, the kind of fault that starts fires inside walls. One protects people from shock, the other protects the building from fire. Neither replaces the other, and neither one creates a ground where the wiring doesn’t already have one.
That last point trips up a lot of older homes. If a GFCI keeps tripping the second you reset it, or won’t reset at all, the device may have failed, or there may be a real fault downstream that it’s correctly catching. Both are worth a look. A GFCI that nuisance-trips gets ignored until the day it’s protecting you from something genuine.