IR sensors operate by emitting infrared light, which interacts with the molecules in the sample. When the IR light encounters a molecule, it can be absorbed at specific wavelengths corresponding to the vibrational frequencies of the molecular bonds. The sensor then detects the amount of light absorbed at each wavelength, creating an IR spectrum that serves as a molecular fingerprint.