Heat decides the state of matter. Heat plays an important role in converting one state of matter to another. Adding heat or taking off heat brings in change of state/phase.
Soild → Liquid.
This is called melting process ( solid needs to be heated, example melting of butter, solid on taking up heat changes to liquid)
Liquid → Solid
This is called freezing process ( liquid needs to be cooled off, example freezing of water, liquid on losing heat to surroundings cools off to form soild.)
Liquid→ Gas
This is called evaporation process ( liquid needs to be heated, example evaporation of water, water on taking up heat from the flame or from the surroundings changes to gas)
Gas → Liquid
This is called condensation process ( gas needs to be cooled, example condensation of steam on the mirror, when one throws steam on mirror or cold surface, steam or gas loses heat to the surface and changes to gas)
Soild → Gas
This is called sublimation process ( solid needs to be heated, example leaving dry ice on the surface, solid dry ice gains heat from surroundings and turns into gas.