The Carnot cycle is an ideal reversible cyclic process involving the expansion and compression of an ideal gas, which enables us to evaluate the efficiency of an engine utilizing this cycle.
Each of the four distinct processes are reversible. Using the fact that no heat enters or leaves in adiabatic processes we can show that the work done in one cycle, W = Q1 - Q3 where Q1 is the heat entering at temperature TH in the isothermal process A -> B and Q3 is the heat leaving at temperature TC in the isothermal process C -> D.
Remember, this is the ideal heat engine (reversible) efficiency. It sets the maximum theoretically attainable efficiency of any real engine operating between the same two temperatures.
Be careful. The temperatures in the ideal gas law must be in Kelvin, therefore the temperatures in the efficiency equation are also in Kelvin.