How energy stored in magnetic field gets used up? An inductor stores energy in form of magnetic field. In case of capacitors the energy is stored in electric field, and since electric field can do work the stored energy can be spent. Here, magnetic field does not do work, then how stored energy gets spent?
 A: "magnetic field does not do work" But when the magnetic field changes there is an electric field around the changing magnetic field. The electric field does work on charges, for example those in a coil.
A: Sometimes it's a good method to see things on the particle level.

In case of capacitors the energy is stored in electric field,...

In detail, electrons are separated and accumulated on one side of a capacitor. For the separation is needed energy and connecting the two sides of the capacitor the electrons flow back to the other side. Having some device (resistance, lamp, motor) in the circuit, you’ll “see” the work from this current.

... and since electric field can do work the stored energy can be spent.

The better description is to talk about a potential difference between two points of a circuit. This potential difference is the result of a charge separation. And the charge separation in turn always has the effect of a macroscopic electric field.
Besides the electric charge, the electron is a magnetic dipole. In permanent magnets the macroscopic magnetic field is caused by the alignment of electron (and protons). This self-alignment is destroyed by higher temperatures.
In an inductor the electrons get align with their magnetic dipoles during the electron flow on their spiral path and a macroscopic magnetic field is created. But only for temperatures near zero Kelvin a self-alignment occurs, in the common case the alignment gets lost immediately after switching of the current.

Here, magnetic field does not do work, then how stored energy gets spent?

Starting a current through an inductor, a higher resistance is measurable in the circuit. Partially this resistance comes from the work, which has tobe done to align the electrons magnetic dipoles during their transition through the inductor. switching off the current, for a moment a current in the opposite direction is remarkable (Lenz’s law). this current is the work, realized from the magnetic field of the inductor. And, in detail, it occurs from the return of the aligned electric dipoles into their random directions.
A: The existence, sustained in time, of a magnetic or electric field, entails an energy associated with the existence of such a field. In particular, the electromagnetic energy associated with a generla EM field is given by:
$$\mathcal{E}_{EM} = \frac{1}{2} \int_{\mathbb{R}^3} \left(\varepsilon_0\mathbf{E}^2 +
\frac{\mathbf{B}^2}{\mu_0}\right) \ dV$$
Even if for a specific observer we have $\mathbf{E} =\mathbf{0}$ (not all observers will fulfill that condition) even for a specific field occupying a specific region of space. A magnetic field, even if it does not increase the energy of charged particles, can be used to generate electromagnetic waves. If we derive the expression with respect to time of the electromagnetic energy density we have:
$$\varepsilon_0\mathbf{E}\cdot\frac{\partial \mathbf{E}}{\partial t}+
\frac{\mathbf{B}}{\mu_0}\cdot\frac{\partial \mathbf{B}}{\partial t}=
-\mathbf{E}\cdot\mathbf{j}-\frac{1}{\mu_0}\left(\mathbf{B}\cdot\boldsymbol\nabla \times \mathbf{E} - \mathbf{E}\cdot\boldsymbol\nabla \times \mathbf{B}\right) = -\mathbf{E}\cdot\mathbf{j} - \boldsymbol\nabla \cdot \left( \frac{\mathbf{E}\times\mathbf{B}}{\mu_0} \right)$$
even if initially we have $\mathbf{E} =\mathbf{0}$. The vector $\mathbf{S} := \mathbf{E}\times\mathbf{B}/\mu_0$ is the Poynting vector associated with electromagnetic energy flux. Then, it is clear that the variation of the existing magnetic field will eventually generate an electric field and, therefore, a flow of electromagnetic energy (regardless of whether we initially have $\mathbf{E} =\mathbf{0}$).
