There are many methods used to analyse food for it's component parts. Foods consist of thousands of chemicals, but as you can see from most food labels the important basic groups are: Fats, Protein, and carbohydrates. Each of these requires different tests. It appears the basic tests are chromatography, and spectrometry (proteins, sugars, etc.) and saponification (fats, oils, lipids). To explain this in detail would take an entire course in food analysis such as this one at Rutgers University.
making a small donation to science.ca.