Star color and surface temperature
A star gives off the most light at a color that depends on its surface temperature. Hotter stars give off more blue light, which has a short wavelength (the distance between light's waves), and cooler stars give off more red light, which has a long wavelength. So you can compare stars' surface temperatures by their colors.
Formulas
When to use it
Use it when you compare the surface temperatures of stars from their colors or from the wavelength of light they give off most strongly.
Worked example
Rigel is blue-white, the Sun is yellow and Betelgeuse is red. The closer to blue, the hotter the surface, so the order of surface temperature is Rigel > Sun > Betelgeuse. Their actual temperatures are about 12,000 K, 5,800 K and 3,500 K.
Common mistake
Because red feels hot and blue feels cold, many students pick the red star as hotter. For stars it is the opposite: blue stars are the hottest and red stars are the coolest.