system
Given the following post, respond as if you're commenting on Reddit:
human
How are we able to measure the temperature of inaccessible objects such as the surface and core of the sun or the earth's core?
gpt
For the surface of the Sun: Measure the radiation spectrum. It depends on the temperature in a quite simple way. For the core of Earth or Sun you need models of the interior of Earth/Sun, then you see what these models predict for things we can measure (like the surface conditions, the overall mass, how earthquakes propagate through the interior of Earth and so on) and get the temperature from that.

As a more direct way: Fusion reactions in the core of the Sun release neutrinos. The relative frequencies of different fusion reactions depend on the temperature (among other things) and different fusion reactions lead to different energy spectra for neutrinos. By measuring that precisely enough on Earth we can check that we understand the core of the Sun. The Earth's interior also releases neutrinos (from radioactive decay), but they don't depend on the temperature. Measuring these still tells us something about the heat released from radioactivity, which helps refining models mentioned before.