Heat engines work via the circulation of a working substance from a hot reservoir to a cold reservoir and the transformation of a part of the heat to work.
Heat $Q_h$ is taken from a hot reservoir at a temperature of $T_h$, parts of it is converted to work $W$ by the heat engine, and the residual heat $Q_c$ is dumped into a cold reservoir at a lower temperature $T_c$.
2. Refrigerators
3. Second law of thermodynamics
The second law of thermodynamics implies that perfect refrigerators and perfect heat engines do not exist
Violating the refrigerator statement of second law violates the engine statement.