
Those buttons belong to a GFCI, short for ground-fault circuit interrupter. Its job is to shut off power quickly if some of the current takes a route it shouldn’t. That’s why you’ll often see one near a sink, where things have a way of getting wet.
It keeps count
Picture someone at a busy event counting people going in one door and out another. If those counts stop matching, someone may be using a side door. A GFCI compares the current leaving on the hot wire with the current returning on the neutral. If enough current goes missing from the usual return path, the GFCI trips. That missing current could be going through a person.
What do the buttons do?
Test creates a small imbalance inside the device to check that the protection trips. Reset can restore power after a successful test. One GFCI can protect other outlets farther along the same circuit, including ones with no buttons. That’s how an outlet with a pair of buttons can have a job in two different rooms.
Fun detail. A regular circuit breaker looks for too much current. A GFCI looks for a difference in where the current is going. Those are two different ways to tell something’s wrong.
For more on current, circuits, and how electricity gets to the outlet, see Basics of Electric Utilities 101.