Spectroscopy
To be analysed the chemical is heated, because each chemical glows differently. The various wavelengths of the glow make a color spectrum which differs in some detail from other chemicals. Spectroscopy separates and measures the brightness of the different wavelengths. It can identify the chemicals in a mixture, and determine some other things, such as how hot the thing is.