An inductor is a device which temporarily stores energy in the form of the magnetic field. It is usually a coil of wire. One of the basic property of the electromagnetism is that when you have current flowing through the wire it creates a small magnetic field around it.
One current first start to flow through the inductor a magnetic field start to expand then after some time magnetic field becomes constant then we have some energy stored in the magnetic field.
Once a constant magnetic field is generated in the Inductor, it will not change any further. As magnetic flux = N x I (Turns x Current), Inductor will draw a constant current to maintain the magnetic field.
Once current stop flowing the magnetic field start to collapse and the magnetic energy turned back into electric energy.
So when the current flowing through an inductor changes, the magnetic field also changes in the inductor and emf (electromotive force) is induced in the inductor as per Faraday’s law of electromagnetic induction.
According to Lenz’s law, the direction of electromotive force(emf) opposes the change of current that created it. V= -Lx dI/dt (rate of change of current)
So inductor opposes any change of current through them.