Why are some stars blue, some white, some red?

The stars of the globular cluster NGC 6355, which resides in our Milky Way galaxy’s inner regions are seen in this Hubble Space Telescope image.
| Photo Credit: ESA/Hubble & NASA, E. Noyola, R.
The main reason is surface temperature.
Stars behave roughly as objects that absorb all incoming radiation and radiate energy back based solely on their temperature.The colour we see depends on the wavelength of light where the star emits the most energy. According to Wien’s law, hotter stars emit more energy at bluer wavelengths.
Blue and blue-white stars have surface temperatures of 10,000 K or more. These are usually very massive stars with nuclear fusion happening at a furious rate. Examples include Rigel and Spica. White stars’ surfaces are at 7,500-10,000 K, hot enough for the peak radiation to be in the visible spectrum. To the human eye, colours appear together as white. This is also why we don’t see green stars: they also emit other colours that the human eye mixes together. Examples include Sirius A and Vega.
Yellower stars such as the sun and Alpha Centauri A have surfaces at 5,200-7,500 K. Finally, orange and red stars’ surfaces are up to 5,200 K hot. These are the coolest stars and emit most of their energy as infrared radiation. Examples include Betelgeuse and Proxima Centauri.

