Second Law of Thermodynamics
The Second Law of Thermodynamics state that heat flows spontaneously only from hotter to colder bodies.  This implies that a steam engine can do work only with a drop in temperature.  The steam the enters a steam turbine is hotter than the steam that exits it.  The loss in heat energy by the steam is converted by the turbine to electricity.  It is really a two step process first from heat to mechanical energy and then to electrical energy.

This law tells us something about whether or not a given process will occur.

We also are interested in how efficiently the energy is transferred into useful work.

The efficiency of any engine is defined as the amount of work produced divided by the heat enrgy absorbed:

efficiency = W/Q

Carnot proved that the efficiency of a steam engine is related to the heat content of the steam as follows:   W/Q2 = (Q2 - Q1)/Q2 where Q2 is the heat content of the hot steam and Q1 is the heat content of the cold steam.
Lord Kelvin related heat content to his temperature scale  Q2/Q1 = T2/T1

Therefore efficiency became equal to either (Q2 - Q1)/Q2 or (T2 - T1)/T2

What does this imply for the temperature that steam should be heated to, to make a more efficient engine??

We now see that only a part of the heat put into the system goes to do work.  What happens to the rest??

Is it lost ???  No, the first law states that energy can be neither created nor destroyed.
Therefore it goes into the system in the form of Entropy.  We use S as the symbol for entropy

Change in S = Q/T

Entropy is defined as the amount of energy unavilable to do work.

If the process is reversible then the net change in entropy of the system and its surroundings is zero.

If the process is irrevesible and spontaneous the net change in entropy is plus.

It is also useful to relate entropy to the absolut temperature and changes in S to changes in T

Change in S =  Cp ln (T2/T1)  where Cp is the heat capacity of the system

The Third Law of Thermodynamics is discussed on the next page.

Please click and read on.