To take one point, how do we know what the sun is made of?
Well, that’s an interesting story. For a long time, no one had any idea what the sun or other extraterrestrial bodies could be made of.
Then a guy named Fraunhofer discovered that if you looked carefully at a spectrum caused by passing sunlight through a prism, there were mysterious dark lines. Further experiments showed that these sorts of lines were present when spectra were created when different substances were heated to glowing hot.
And when the lines created by incandescent hydrogen was compared to the sun, they matched. And so we now realized that the sun was composed of hydrogen.
However, something mysterious was also discovered. There was a band that corresponded to no known substance. And so it was theorized that there was some unknown element in the sun, and the substance was named “Helium”, after the greek god Helios. Of course, that gives away the later discovery that helium was also present on Earth, and is now used in all sorts of applications.
And the same spectroscopic technique can be applied to all sorts of things. We can directly observe spectroscopic lines in incandescent substances, but it turns out that cold substances absorb and reflect light in characteristic ways, and so we can often tell what something is made of merely by looking at it through a specialized prism called a spectroscope.