Direction of natural change

The Second Law of Thermodynamics is based on observations of the direction of natural (spontaneous) change.  Principles arising from the second law of thermodynamics can be used to predict the direction of natural change for chemical systems. that is the direction in which a given reaction will occur to reach equilibrium.

The Second Law of Thermodynamics 
A process is spontaneous in the forward direction if the total entropy change for the process is positive

The total entropy change includes the entropy change of the system under study and its surroundings as shown in (1).
 
(1) ΔS(total) =
ΔS(system) + ΔS(surroundings)
> 0

Considering the system:
The entropy change for a reaction system depends on the nature and the state of the reactants and products.
 
ΔS(system) for a spontaneous process can be either positive or negative.

Consider two spontaneous processes:
H2O(l)  H2O(g) at temperatures above 100 °C (2)
ΔS(system) is positive (the extent of random motion in a gas is greater than in a liquid)
H2O(l)  H2O(s) at temperatures below 0 °C (3)
ΔS(system) is negative (the extent of random motion in a solid is less than in a liquid)

Considering the surroundings
ΔS(surroundings) for a spontaneous process can also be either positive or negative

Deducing the sign of the change in the entropy of the surroundings from a property of the system
The surroundings of any reaction system is likely to be a mixture of substances (like in air).  The entropy change for the surroundings can be deduced from the thermochemical properties of the reaction system.

Release of heat to the surroundings by exothermic (ΔH negative) reactions increases the extent of random motion of particles in the surroundings, and ΔS(surroundings) is positive. 

If the reaction is endothermic H positive ), heat is absorbed from the surroundings
This decreases the extent of random motion of particles in the surroundings, and ΔS(surroundings) is negative. 

This relationship makes the assumption is made that heat transfer between the system and the surroundings at constant pressure (qp) is complete. 
 
(2) ΔS(surroundings) =qP= –ΔH(system)
TT

Thus the sign of ΔS(surroundings) is the opposite of the sign of ΔH(system).

Heat released to the surroundings makes the particles in the surroundings move faster.  The freezing of water at temperatures below 0 °C is an exothermic process.  The energy of the products is lower than the reactants because particles that are attracted to one another are closer together.