How do we characterize a star? Spectroscopy!
Remember that light can be broken into a spectrum sorted by wavelength by use of a prism or other, more complicated spectrographs.
These lines yield a unique fingerprint of each element in the periodic table.
So by taking light from an object and spreading it into its spectrum we can determine what the object is made of.
It wasn't until 1814 that a German Optician, Joseph Fraunhofer, that pointed a prism at the Sun and discovered lines in the Sun's spectrum that corresponded to known elements on the Earth. Before this time it wasn't known if the rest of the Universe was even made of the same stuff as we are.
It turns out that Newton was the first person to send light
through a prism, a couple hundred years earlier. But he did not see
any spectral lines because his equipment was not powerful
enough.