It is a long straight coil of wire that can be used to generate a nearly uniform magnetic field similar to that of a bar magnet.
When the electric current passes through the coil, it creates a relatively uniform magnetic field inside the coil.
The soft iron inside the coil makes the magnetic field stronger because it becomes a magnet itself when the current is flowing. It is then called an electromagnet.
Soft iron is used because it loses its magnetism as soon as the current stops flowing. Hence, soft iron is said to form a temporary magnet.
The solenoid can be used as an electromagnet, as an inductor or as a miniature wireless receiving antenna in a circuit.
At the centre of a long solenoid, B (magnetic field strength) =μnI, where μ is permeability, n is the number of turns, and I is the current flowing through it.