Relays are electrically operated switches that use an electromagnet to control the opening and closing of contacts. When an electrical current flows through the coil, it generates a magnetic field that actuates the relay's contacts, enabling or disabling the circuit