An inductor is just a coil of wire. When current flows through it, it builds a magnetic field, and that field doesn't like to change. Everything drawn in blue can be clicked or dragged: flip the switch, slide the iron core in and out, turn the supply's knobs, and watch what the coil does to the LED.
Fig 1How a coil fights changeBlue parts: click or drag them
Current: the dots on the wires, and the bright traceCoil voltage: the coil pushing back (second trace, right meter)Supply voltage: the dashed traceA supply pushes current round one loop: switch, resistor, coil, LED. The coil (an inductor) stores energy in its magnetic field, so it fights every change in the current: it slows the current down when the supply switches on, and keeps it going when the supply switches off. The iron core makes that effect about ten times stronger. Real coils do this in thousandths of a second; the figure runs in slow motion.
Try this each one sets the bench for you
How it works
1 · A coil is lazy about change
An inductor is wire wound into a coil. Current through it makes a magnetic field (watch the compass swing). Building that field takes energy and time, and once it is built, it wants to keep going. So the coil fights any change in current: it fights the current starting, and it fights it stopping. Think of a heavy cart: hard to get rolling, and hard to stop once it rolls.
2 · Switching ON
When you turn the switch ON, the coil pushes back against the supply (the right meter swings the other way), so the current can only grow little by little. The LED fades up instead of snapping on. The bigger the coil, the slower the fade. Once the current stops changing, the coil stops pushing back, and it acts like a plain wire.
3 · Switching OFF
OFF takes the supply out but keeps the loop closed. Now the coil does the pushing: its field collapses and keeps the current flowing in the same direction, so the LED keeps glowing for a moment with no supply at all. The coil's voltage flips sign, and the energy stored in its field is used up in the resistor and the LED.
4 · Blinking and waves
If the supply blinks slowly, the coil has time to catch up and the LED blinks fully. Blink faster and the coil never has time: the current only wiggles a little around its middle, so the LED glows steadily at about half brightness. With a wave, the current lags behind the push. Coils are used like this in real circuits to smooth out bumpy currents.
For grown-ups vL = L · di/dt
The coil's voltage is its inductance times how fast the current changes. In this loop the supply's voltage is shared: vsupply = i·R + vLED + vL, with R = 220 Ω for the resistor plus 30 Ω of coil wire, and a red LED that starts to glow at 1.75 V. The current approaches its final value with time constant τ = L / Rtotal: about 63 % after τ, and essentially all of it after 5τ. Inductive reactance XL = 2πfL is why fast changes get through so poorly.