what is solenoid?
A solenoid is a type of electromagnet, the purpose of which is to generate a controlled magnetic field through a coil wound into a tightly packed helix. The coil can be arranged to produce a uniform magnetic field in a volume of space when an electric current is passed through it.
When an insulated copper wire is wound on an iron bar or rod-shaped iron/solid steel and current is passed through it then its starts acting like an electromagnet and it's called an solenoid.