system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: how do drugs like tylenol and advil know where the pain is and sooth a headache?
gpt
First, it's important to note that if you read the package inserts on medicine closely, you'll see that each notes that the actual method of action (the nitty gritty of how it works) is unknown, but the scientists/pharma companies have a pretty good guess. 

Second, Tylenol and Advil are both analgesics (pain relievers), but are in different "classes" of drugs and work different ways. 

Tylenol, aka acetaminophen, works mainly in your central nervous system (brain and spine). It inhibits the "reuptake" (think signal) of certain chemicals in your nerves that are responsible for telling your brain that you are in pain. So, it really doesn't "know" where the pain is in your body, it's just blocking everything. Think of it like a dam on a river... whatever it is that's causing your pain is still there, but now it's behind your tylenol dam and the only pain that's getting through is the little dribble that comes over the side. 

Advil, aka Ibuprofen, is what they call an "NSAID" or "Non-steroidal Anti-Inflammatory Drug." It works mostly in your extremities. When your body suffers an injury, like a broken ankle, the injury site produces chemicals called "COX"s for short. Advil is attracted to those chemicals like a magnet. It goes to wherever those chemicals are and dams up the production. The reason why it works for your pain is because the chemicals that it slows down are responsible for all the blood rushing down to wherever your injury is and generally speaking, the less swelling and inflammation, the better for your pain. 

Hope that helps.