What is temperature?
A lot of people have trouble with this definition in chemistry classes because they are given a long and complicated definition. I will give the complete definition of temperature first and then attempt to simplify it for you. What I want to point out before hand is that temperature is a measurement. Temperature is measuring the average kinetic energy of the molecules of a substance (solid, liquid, or gas). Usually at this point teachers and books go on to explain more about kinetic energy with a mathematical equation. I am not a fan of that, and you do not need to know that mathematical equation for chemistry. However, if you want that explanation the link is there. To put it simply, kinetic energy has two variables (things) that can effect it. That is the mass of the molecule (particle) or the velocity (speed) of a molecule (particle). For gases, if we assume all of them have about the same mass, we can deduce that the velocity (speed) at which they are traveling is the main contributor to their kinetic energy. Therefore, since temperature measures kinetic energy and kinetic energy is mostly determined by the speed of the molecule, it is not too much of an assumption to say that temperature is mainly a measurement of how fast molecules (particles) are moving.
The HIGHER the temperature the FASTER molecules are moving.
The LOWER the temperature the SLOWER molecules are moving.
How does temperature affect the state of a chemical?
As molecules speed up their vibrations or collisions this creates more space between one molecule and another. This is much like the situation when you have a crowd of people and one person starts violently flailing or moving quickly the crowd around them moves further away because they are pushed further away. As we continue to create more space between molecules they become closer to the gas state. Lets review what we just said.
If we constantly drive the TEMPERATURE HIGHER then that creates MORE SPACE between the molecules and they will eventually be in a GAS STATE.
If we constantly drive the TEMPERATURE LOWER then that creates LESS SPACE between the molecules and they will eventually be in a SOLID STATE.
Below I have created a simple picture to describe this situation.