Can you tell us what country you're in? It can help determine what the
best path forward might be, from a supply-chain standpoint, legal,
etc...
The answer to your question lies largely in the domain of chemistry
and physics. You need to figure out how to determine naturally present
chemicals from the non-naturally present chemicals. For example, milk
fat vs palm oil: these are likely to be mostly the same chain-length
(number of carbons in the oil molecule chain) but probably differ
slightly in their populations (maybe milk fat has mostly 16 carbons,
but some percentage of 14 carbon molecules too... while palm oil is
mostly 16 carbon molecules, with some percentage of 18 carbon
molecules). Along with the chain-length population differences, which
way the molecule is bent at each carbon could be slightly different.
It is much easier to distinguish chains of different length which all
have the same bending configuration, than it is to distinguish between
chains of different length with different bending configurations...
for example... with simple techniques (bending configuration aside,
the chain-length largely determines the melting/solidification point).
So when you move on to other molecules... searching antibiotics
amongst all the tens/hundreds of thousands of different molecule types
floating in all the cells of the food you buy... you can see the task
is HUGE.
You have to be very clever (for example, some very powerful machines
use very smart and beautiful solutions to extract data and make sense
of it, often these use tools or data-processing based on complex math)
, or very patient.... or usually both.
Personally, I think there are some common-sense techniques that you
could start applying now, to avoid food that is worse quality...
without investing in equipment, rather spending time learning about
which foods are more susceptible to contamination to begin (i.e. sweet
fruits tend to have heavier pesticide use). Also humans have an immune
system and other ways to deal with toxicity... so for example if you
wanted to have a baby and raise it, the food the mother consumes
during pregnancy and while nursing, and the food the baby receives in
general the first few years... is much more important to be concerned
with. After early development, humans are much more able to defend
against bad chemicals and infections.
If you really want to get into equipment... I recommend learning
about: UV/Vis spectrophotometry, FTIR, Gas-Chromatography, Mass
Spectrometry, Raman spectrophotometry, Thin-layer chromatography,
fractional distillation, redox indicators, ELISA, antibiotic
susceptibility assays, PCR... and as many related topics as you come
across.
Cheers!
-Nathan
-Nathan