The more energy they have, the faster the particles move. Indeed, due to collisions with other particles, any one particle changes its speed as time goes on. So we tend to think of all the particles as a population and most of them will be moving at different speeds. The Boltzmann-Maxwell distribution plots the energy of particles against their speed and the graph looks like a lopsided curve. You should understand and try to imagine that the position of the curve, including its peak, changes as the temperature changes.
Particles lose energy and that energy is emitted as light.
Indeed, the emission of light is the ONLY way a particle can lose energy in a vacuum. As a matter of fact, that is the surface temperature of our Sun but this could just as well be the light from the surface of any star with a surface temperature of 5500 o C. Notice that the peak emission is in the yellowish part of the energy spectrum. That is why our Sun looks yellow. If the Sun grew hotter, the ions on its surface would move faster and the Boltzmann-Maxwell distribution would shift to the right, carrying the peak with it. Then the overall color of the Sun would shift towards the bluer end of the spectrum and our Sun would take on a more greenish hue.