system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do they know what chemicals your brain is producing in response to certain stimuli when it should involve opening your head to watch it?

They say that the brain releases dopamine when X happens, or releases oxytocin when X happens, etc. How do we know that's happening inside somebody's head without cracking their skull open?
gpt
Mostly indirect evidence, eg. we know that X is swirling around your brain because we took a blood sample and its high in Y which corresponds to X in scenario Z. Alternatively, we injected you with X which makes Y light up on your brain scan while we show you pictures of your parents getting handsy.

Sometimes semi-direct evidence, like having brain cells in a petri dish and observing them respond to stimuli or chemicals.

Sometimes also direct evidence like actually having a rats skull open and continuously probed as scientists(hopefully) feed the rat sugar or something.

All of it builds a knowledge base which is used to make accurate observations via indirect evidence.