A substance is held in an open container. Its particles move past one another at random speeds but do not leave the container.
https://cdn.app.edmentum.com/EdAssets/a63bfe4a27294d5eb1faaf145376dad4?ts=635018086749300000
Heat is removed from the system, and the particles slow down. When enough heat is removed, the particles no longer have enough speed to overcome the weak attractive forces between them. When this happens, the substance enters its solid state.