Including so many other uses, but an inductor is a passive electronic component that temporarily stores energy in a magnetic field when electric current flows through it’s coil.
In its simplest form, an inductor consists of two terminals and an ‘insulated’ wire coil that either loops around air or surrounds a core material that enhances the magnetic field.
Inductors help to handle fluctuations in an electric current running through a circuit.

As demonstrated in the video below👇, when an electric current flows through a conductor such as copper wire, the current generates a small magnetic field around the wire.
If the wire is shaped into a coil, the magnetic field becomes much stronger.

If the wire is coiled around a central core made up of a material such as iron, the magnetic field grows stronger still — this is essentially how an electromagnet works.

The magnetic field completely depends on the electric current. Changing the electric current also changes that field. 

You may want check out this video for demonstrations!