A useful mental model of a inductor for the purpose of designing circuits is that inductors impart inertia to current. This is false and non-sensical at the physics level, but a useful abstraction when trying to picture what a inductor does in a circuit.
Consider current running thru a piece of wire. There is always some unavoidable inductance, but for individual wires it's usually so small we can ignore it. Let's say you connected this wire to a 5 V source with 5 Ω in series across the ends of the wire. As soon as you connect it, 1 A will flow instantly. When you disconnect it, the current stops flowing instantly and goes to 0 A.
Now replace that wire with a inductor. When you first connect it, the current will ramp up, not jump to the final value instantly. Actually, the current is a exponential that asymptotically approaches the steady state value of 1 A. The larger the inductor, the larger the time constant.
One way to mentally picture this (again, don't try to think of the physics this way) is that the inductor gives inertia to the current. When you first connect the "push" (the voltage), the current starts going up.
Now think of what happens when the circuit is opened. The current thru the inductor doesn't want to stop suddenly, just like a car going down the road can't stop suddenly. It takes a sustained force over some time to stop the car.
Likewise, it takes a sustained reverse voltage over some time to stop the current. But I can hear you thinking, we just opened the circuit, so there can't be any current. The problem is that this is a case where the approximation of all components being ideal breaks down. Somewhere there is a switch that has to open to stop the current flowing. That could be a transistor or a mechanical contact.
Let's look at what happens as a mechanical contact opens. It can't instantly jump from connected to far apart. At some point, it just starts to open, and there is a very small air gap between the contacts. Due to the "inertia" of the current, the current can't change instantaneously. Immediately after the contacts open, the voltage goes high enough to arc across the little air gap, which continues to allow current to flow. That does cause some voltage across the switch, which applies reverse voltage across the inductor, which cause the current to decrease. Eventually the current goes to 0, and everything is back to the open-circuit steady state.
You may have a problem imagining how this inductor can make a high voltage. Think of the car being slowed down. When it is slowed down normally, the brakes cause a reverse force, which causes the speed to go down until it eventually gets to 0. However, trying to open the circuit quickly with a mechanical switch is like the car hitting a solid wall. The reverse force gets very high. Due to being so high, it stops the car quickly (and in this case destructively).
In the case of a inductor and mechanical switch opening, it's the switch that gives a bit, unlike the car hitting a wall where the car gives instead of the wall.
Go back to the basic equation of what a inductor does, and you can see this behavior described mathematically:
dI = V dt / L
A voltage (V) applied for some time (dt) cause a current increment (dI) inversely proportional to the inductance (L). In common units:
dA = V ds / H
dA is the current increase in Amperes, V the voltage, ds the seconds the voltage is applied, and H the inductance in Henries.
For example, if you apply 5 V to 100 mH for 30 ms, the current rise in the inductor will be (5 V)(30 ms)/(100 mH) = 1.5 A.
This ability of a inductor to make a high voltage when you try to stop the current thru it quickly is the basis for how boost converters work.
First, the inductor is "charged up" by connecting it between the input supply and ground. This is done by closing the switch. That causes the current thru it to rise linearly.
When the current gets to a nice level, the switch is opened. The inductor current can't stop instantaneously. The inductor makes whatever voltage it takes to keep the current flowing in the short term. The current therefore flows thru the diode, charging the output capacitor. This puts reverse voltage across the inductor, reducing its current over time.
This switch is then closed again. That stops current from flowing to the output, but builds up current in the inductor. This process repeats rapidly to deliver lots of little shots of current to the output.