The process of conversion from solid to liquid (melting) , liquid to gas (vaporization) , gas to liquid (condensation) , liquid to solid (freezing) is accompanied by absorption or release of heat.
Till all the substnace change the state latent heat is required/released that is why the temperature of the substance remains constant during change of state.