A relay is an electrically operated switch that is used to control a circuit by opening or closing contacts in response to an electrical input. Relays are commonly used in applications where one circuit needs to control another circuit, such as in industrial automation, automotive electronics, and electronic devices.