An electromagnet works based on the
Magnetic effect of electric current
Electromagnet is a soft metal core made into a magnet by the passage of electric current through a coil surrounding it. It is based on the magnetic effects of electric current.