system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do people initially determine the amount of protein, carbohydrates, and fat in a food item?
gpt
Foods are pretty complex, so the tests used also get complicated pretty quickly, but there are a couple basics.  For fat, you can weigh the food first, then wash out the fat with special liquids (solvents).  You can remove the solvents from the fat to get the weight of fat alone.

For protein, people usually look for the element nitrogen.  There are specific measuring methods to get the amount of nitrogen in the sample, and then a mathematical formula is used to convert that to an amount of protein.

Carbs are kind of assumed to be what's left over from the other two kinds of tests.