An electromagnet is a coil of wire which has an electric current flowing through it. When the wire is coiled around in a cylinder, it is called as a solenoid. The solenoid becomes an electromagnet when a current flows through it.
Magnet wire or enameled wire is a copper or aluminum wire coated with a very thin layer of insulation. Magnet wires are commonly composed of fully annealed, electrolytically refined copper to allow closer winding when making electromagnetic coils. Usually, the copper wires which are perceived to be bare are actually coated with lacquer or a similar material.
It is important for the cable and wires to be insulated as it prevents the insulated wire's current from coming into contact with other conductors. It preserves the wire material against environmental threats and resists electrical leakage.
Copper is used in these electromagnets as coiled wire because it has a low electrical resistance i.e., it is easy for the current to flow through it. Also, a copper wire can be easily shaped to make a coil.