Hi Rebecca
We look at the color of the light that the sun emits. If something gets
hot, say an iron bar in held in a fire, then it starts to glow, and the
color it glows with tells us how hot it is. Early in the 20th century a
physicist called Max Planck worked out how temperature and color of a
hot object are related. This is called the 'Planck radiation law'.
Roughly speaking, An object (like a star, or an iron bar) that is
glowing blue-white, is hotter than one which is glowing yellow, which
is in turn hotter than one glowing red. The sun is glowing yellow -
from this we can tell its temperature is 6,100 degrees centigrade - or
about 11,000 Fahrenheit.