Yes, it can change states of matter from heat. Like ice, ice changes it’s state of matter from the temperature it is in, which causes it to turn into a liquid.(another form of matter) Again with heat, if water is boiled to a certain temperature it converts to a gas. Now with cold. If water is at such a coke temperature it will turn to ice, a form of matter. Now when a gas is cooled down, the atoms comprising the gas have less energy to move around.