The contraction of an interstellar cloud is followed. The results indicates that there are shock waves appear during contraction. In order to study the effect of shock waves, two models have been studied. The post-shock temperature for the two models are, respectively, 3006 K and 2984 K. The density increases by more than three orders of magnitude. The gas is generally cooled by atoms, molecules, and grains. The dominant cooling process changes according to the chemical composition and the temperature of the gas. The thermal equilibrium depends on the existing physical conditions.