An electromagnet is a type of magnet that produces a magnetic field through the flow of electric current. It consists of an insulated wire wound around a core made from a ferromagnetic material, such as iron or steel. When an electric current flows through the coil, it generates a magnetic field in the same direction as the current flow. This means that when the current is on, the electromagnet attracts ferromagnetic materials and repels other magnets. However, once the current is turned off, the magnetic field collapses, causing the electromagnet to lose its magnetic properties until it is re-energized with a new current flow. Electromagnets are widely used in various applications such as lifting or moving objects using cranes and elevators, separating materials through magnetic attraction or repulsion, and even in medical equipment like MRI machines.