It's basically "look at far away object with a fancy pair of sunglasses."
Because of quantum mechanical reasons, molecules can only absorb and emit light with very particular energy levels (which correspond to frequency/wavelength). So point your camera at an exoplanet and carefully record the amount of the light you see at different wavelengths. My guess is that it's based on IR spectroscopy, since there's a nice region of that spectra where you can "fingerprint" a molecule based on the peaks in absorption in that region (it's literally called the "fingerprint region").