Sunlight can be broken into its constituent colors using a prism. The colors are the optical spectrum of the Sun. They are the same colors on rainbows. On careful observation, the spectrum is not perfectly continuous, but it has dark lines scattered over the entire spectrum. It turned out that from the lines, we can tell the composition of the Sun without physically getting there.
Some flat-Earthers think that it is impossible for us to determine the composition of the Sun, as it is impossible for anyone to visit the Sun without getting roasted in the process. They are wrong. The composition of the Sun can be determined from the spectral lines, or more specifically for the Sun: the Fraunhofer lines.
In 1802, William Hyde Wollaston was the first person to note the appearance of dark features in the solar spectrum. In 1814, Joseph von Fraunhofer independently discovered the same phenomenon and made a careful measurement of these features.
45 years later, Kirchoff & Bunsen discovered that some of Fraunhofer lines coincide with the emission lines from heated elements. It turned out that the lines are caused by absorption of chemical elements on Sun’s outer layer and also Earth’s atmosphere.
Spectroscopy —and more specifically astronomical spectroscopy— is the study of astronomy using the measurement of the spectrum of electromagnetic radiation. From this, we can determine many properties of stars, such as composition, temperature, density, mass, distance, luminosity and relative motion.
Flat-Earthers think the composition of the Sun can only be known by physically going there and sample the surface of the Sun. They are wrong. We can determine the composition of the Sun from a safe distance using the knowledge of astronomical spectroscopy.