Electromagnet is a temporary magnet formed when electric current flows through a wire or other conductor. Most electromagnets consist of wire wound around an iron core. This core is made from magnetically soft iron that loses its magnetism quickly when the electric current stops flowing through the wire.