The colour that we see coming from any object depends on its temperature. When a piece of coal is not lit and therefore it is just at room temperature the light it emits is weak infrared light. We can not see infrared with our eyes so the coal looks black to us (black means no light is emitted). When we burn coal and therefore heat it up to a few hundred or thousand degrees is starts to emit red light which is the weakest visible light. If we were to increase the temperature much higher the coal would emit white light which is more energetic than red light. There are reasons why coal doesn’t emit blue light, but if we heat something else up to really high temperatures we will see blue light coming from it. So when we see blue stars in the sky we know these are much hotter than red or yellow stars. There is an equation that tells us what colour we will observe for an object of a particular temperature and it is called Wien’s displacement law. Objects that obey this law are referred to as blackbodies.