This was the first thing I learned about when I started working at a Pharmacy (was only a clerk). Another helpful tip is that if you take ibuprofen with some coffee it enhances the effects of the pain relief.
For headaches I do something different than I do for muscle aches than I do for blunt trauma than I do for lacerations than I do for back pain. There are many different kinds of pain with many different causes and those causes respond differently to different analgesics.
Fortunately I have a troublingly-high pain threshold (got a scar from a nail in a sauna without really even noticing; I used to think it was cool until i realized my grandfather died from necrosis associated with peripheral numbness and diabetes) so I use effectively nothing for most things, and aspirin/caffeine for headaches.
I'll say this: tylenol is useless for pain and gangbusters for reducing my daughter's fever. Ibuprofen seems to work when there's dire muscle pain. Wondering if the caffeine enhances ibuprofen the same way it enhances aspirin.