Solids
When a solid absorbs heat, its particles vibrate more quickly. This causes the solid to expand and its density to decrease. If the solid absorbs enough heat, it will eventually melt and become a liquid.
When a solid releases heat, its particles vibrate more slowly. This causes the solid to contract and its density to increase. If the solid releases enough heat, it will eventually freeze and become a gas.
Liquids
When a liquid absorbs heat, its particles move more quickly and spread out. This causes the liquid to expand and its density to decrease. If the liquid absorbs enough heat, it will eventually boil and become a gas.
When a liquid releases heat, its particles move more slowly and come closer together. This causes the liquid to contract and its density to increase. If the liquid releases enough heat, it will eventually freeze and become a solid.
Gases
When a gas absorbs heat, its particles move even more quickly and spread out even further. This causes the gas to expand and its density to decrease. If the gas absorbs enough heat, it will eventually become a plasma.
When a gas releases heat, its particles move more slowly and come closer together. This causes the gas to contract and its density to increase. If the gas releases enough heat, it will eventually become a liquid.