A heat engine is a system that takes heat as input from a hot body(reservoir) and converts some part of this heat energy into work and gives the remaining heat to a cold body(sink) as shown in the diagram.
The work can be mechanical, electrical, etc.
An ideal heat engine is one that is capable of converting the entire heat energy into work. Hence by conservation of energy, no heat is given to sink.
The efficiency of an engine is defined as the ratio of the amount of work done by the engine to the amount of heat the engine took as input. i.e. .
Clearly, the efficiency of an ideal heat engine is 1 or 100%.