Carnot theorem states that
All reversible engines operating between the same two temperatures (infinite heat reservoirs) have equal efficiency and no engine operating between the same two temperatures (infinite heat reservoirs) can have an efficiency greater than this.
A Carnot engine is a reversible engine, that does work by taking in energy.
This theorem is a direct consequence of the 2nd law of thermodynamics.
The efficiency of energy transfer can be calculated also as
This principle is used practically in many heat transfer based applications like a refrigerator, AC, in vehicles, heating furnaces etc.