We can analyze distant stars by investigating the spectrum of their light. But we have billions of stars in the sky, and I wonder how it is possible to isolate the light of one particular star from the other stars.
Good question! The basic idea is to use a telescope to image some region of space, place an aperture that passes just the light from the star you wish to study, and then couple that light into a spectrometer. There is a good video demonstration of this process that you can watch here.
To enlarge upon pQ12branch's answer, you can use fiber optics with your telescope to record dozens of spectra from different stars within the telescope's field of view, all at the same time. you simply line up the end of a fiber with the focal position of a given star in the telescope's "eyepiece" and then put a spectrometer at the other end of the fiber.