A safety relay is a specialized relay used in safety-critical applications to ensure that machinery and equipment operate in a safe manner. It monitors and controls safety functions, such as emergency stops, safety gates, and light curtains, to protect personnel and equipment from harm.