Let's explain it this way: usually, the hotter the substance, the smaller the waves. For example, we can see iron burn red hot because when it burns at that heat, we can see longer waves, which are red and orange.In terms of the sun, the sun is really hot and is meant to be blue in colour, but because of cosmic dust in space, overall, it changes to red instead. This is why the sun emits blue waves and scatters all over the atmosphere, which is why the sky is blue.