Two physical factors are temperature and pressure which regulate the interchanging of physical states of materials.
On increasing temperature or lowering the pressure, the kinetic energy of the molecules increases, and hence the attraction between the molecules decreases and they transform from solid to liquid and then into gas.
The reverse process takes place when we decrease the temperature or increase the pressure.
So, On lowering the temperature the kinetic energy of the molecules decreases, and hence the gas liquefies, and on further increasing the pressure the gas can be solidified also.