Jerromyjon,
My advice: First learn the Carnot engine. Then, learn about other types of engines.
Heat engines receive heat from a high temperature source, they convert part of this heat to work (usually in the form of a rotating shaft), they reject the remaining waste heat to a low-temperature sink, and they operate on a cycle. Heat engines usually involve a working fluid to and from which heat is transferred while undergoing a cycle. Internal combustion engines technically do not operate on a thermodynamic cycle. That is the working fluid (combustion gases) do not undergo a complete cycle; new combustion gases are injected into the engine at specific times, and the exhaust gases are thrown out at specific times. Since the working fluid is not operating on a cycle, an internal combustion engine is technically not operating on a thermodynamic cycle. But for the sake of simplicity, you can model an internal combustion engine as a heat engine that works on a thermodynamic cycle.
The Carnot cycle consists of four reversible processes. Note that reversible processes never occur in nature. Rather, a reversible process is an idealization. Reversible processes demonstrate the theoretical limits of the corresponding irreversible processes. Factors that cause a process to be irreversible include friction, unrestrained expansion, mixing of two fluids, heat transfer across a finite temperature difference, power dissipation in electrical resistance, inelastic deformation of solids, and chemical reactions.
The four reversible processes that make up the Carnot cycle include:
1. Reversible Isothermal Expansion. The working fluid at some temperature (TH) is brought into close contact with a source at temperature (TH). The gas slowly expands - doing work on the surroundings. As it does so, it tends to decrease in temperature, but as soon as it decreases an infinitesimal amount (dT), heat flows from the source to the working fluid - keeping the working fluid temperature at (TH).
2. Reversible Adiabatic Expansion. The working fluid is now not in contact with the thermal reservoir, and the working fluid is well insulated. So, no heat is transferred to or from the working fluid (aka - adiabatic process). The gas continues to expand doing work on the surroundings, and as it does so, its temperature drops from TH to TL.
3. Reversible Isothermal Compression. The gas (at temperature TL) is brought into contact with the thermal sink at temperature TL. The gas is compressed by an external force, which is doing work on the gas. This tends to cause the temperature to increase, but whenever the temperature increases an infinitesimal amount dT, heat is transferred from the working fluid to the sink. Thus, the gas temperature is held constant at TL (isothermal).
4. Reversible Adiabatic Compression. The gas is now not in contact with the thermal sink and the working fluid is well insulated (thus adiabatic). The gas is compressed in a reversible manner. As it is compressed, its temperature rises from TL to TH, thus completing the cycle.
You should find and study the PV-diagram of the Carnot cycle.
The efficiency of a heat engine:
##\eta = \frac{Wnet,out}{Qin} = \frac{Qin - Qout}{Qin} = 1 - \frac{Qout}{Qin}##
Based on the Carnot cycle and the Carnot principles, a temperature scale can be defined. The second law of thermodynamics only requires that the ratio of heat transfer from a high temperature reservoir to the working fluid of a reversible heat engine to the heat transfer from the working fluid of the said heat engine to a low temperature reservoir be equal to the ratio of some function of the temperature of the high temperature reservoir to the same function of the temperature of the low temperature reservoir.
##(\frac{QH}{QL})rev = \frac{\phi(TH)}{\phi(TL)}##
Lord Kelvin simply chose to let ##\phi(T) = T## so that
##(\frac{QH}{QL})rev = \frac{TH}{TL}##
where ##TH## and ##TL## are absolute temperatures.