Here's how it works:
* Light from the star is passed through the spectroscope. This splits the light into its different wavelengths, just like a prism creates a rainbow.
* The resulting spectrum is analyzed. Each element in the star's atmosphere absorbs light at specific wavelengths, creating dark lines in the spectrum.
* By studying the pattern of these dark lines, astronomers can identify the elements present in the star. This is like a fingerprint for the star's chemical composition.
So, while we can't physically take a sample of a star, the spectroscope allows us to analyze its light and learn about its composition from afar!