Electromagnets are temporary magnets created by running an electric current through a coil of wire. The magnetic field produced by the electric current makes the coil of wire act like a magnet. These are commonly used in various applications such as MRI machines and electric motors.