an inductor
Picture an inductor as a flywheel for electric current. It is usually a coil of wire, and it resists sudden changes in current the way a heavy spinning wheel resists sudden changes in speed. Get current flowing and it tends to keep flowing; try to stop it abruptly and it fights back with a voltage spike.
Here is the mechanism. Current through a coil creates a magnetic field that stores energy. The defining rule is the mirror image of the capacitor: the voltage across an inductor equals its inductance times how fast the current changes, V = L times dI/dt. Force the current in a 10 mH inductor to change at 100 amps per second and you get V = 0.01 times 100 = 1 volt. For steady DC the current is constant, so dI/dt = 0 and an ideal inductor looks like a plain wire, with only its winding resistance left.
Inductors smooth current in switching power supplies, store and release energy in boost converters, and form filters and tuned circuits with capacitors. Honest caveat: that fights-sudden-change property is exactly why opening a switch on an inductive load such as a relay or a motor makes a damaging arc. The flyback diode exists to give that current somewhere safe to go. Real inductors are bulky, have winding resistance, and both pick up and radiate magnetic interference, so designers use them sparingly.
Switch off the current through a relay coil and its collapsing magnetic field can spike to hundreds of volts, enough to arc across the switch. A flyback diode placed across the coil gives that current a safe loop.
An inductor fights a sudden cut in current.
An ideal inductor passes DC freely; only its winding resistance (and, at high frequency, its reactance) limits current. Beginners often wrongly expect it to block DC like a capacitor.