Here is a diagram of how matter can change states.
Add energy to a solid, it melts and changes into a liquid. Add energy to a liquid, it evaporates and changes into a gas.
Remove energy from a gas, it condenses and changes into a liquid. Remove energy from a liquid, it freezes and changes into a solid.