Consider a poker placed in a fire and left to heat up. When the poker is first removed from the fire, it may be so hot that it glows with a bright orange - yellow colour. But as the poker cools, the colour changes, at first to bright red, then getting dimmer until eventually becoming black. In stars, the same effect is observed. The very dim red stars are cooler objects - some are so cool that they are visible only in infra red which lies below visible red in the spectrum.
Astronomers use the technique of spectroscopy to analyse the light from individual stars.
By looking at their colour, and finding out which wavelengths of light are present or absent in the light from the star, we can gain valuable information about the star such as its temperature, pressure, and even how fast it is rotating. In fact, this is nothing to do with the star at all. Instead, the effect is due to the fact that we are looking at the star through the atmosphere of the Earth. The atmosphere contains large amounts of dust, and these dust particles can block the starlight momentarily, making the star twinkle. Stars can change their brightness or magnitude , and we call such stars variable stars.