Hi!
We can tell the temperature of the Sun's surface and atmosphere by observing the Sun's light.
In a general sense, we can tell the Sun's temperature by what color it is. Hotter stars give off a bluer light while cooler ones appear redder.
We can tell by the Sun's color (which is actually white) that its surface is at about about 5,800 K (about 10,000 deg F).
It actually gets a bit more complicated than that. We study particular brightenings at certain colors (called spectral lines) to determine in more detail the temperatures of certain solar features.
To figure out what temperature the Sun is inside we make physics calculations based on the Sun's size, mass, age, and external temperature. We can check these with observations of the Sun's vibrations - this is called helioseismology. It turns out that the Sun vibrates a little differently depending on the temperature at different locations inside! We can also detect flowing material inside the Sun that way too.
To make these measurments we use different telescopes, both on the ground and in space. Inn particular, we use a kind of telescope called a spectrometer which helps break sunlight out into its different colors. I work with spectrometer data a lot.
Terry