We will anaylze this scenario with the help of operant conditioning, which is a type of learning in which behavior is strengthened if followed by a reinforcer or diminished if followed by a punisher. Reinforcer is any event that strengthens the behavior it follows.
Skinner states that "Beahvior is determined and controlled by the stimuli that are present in a given situation"
According to Skinner, when you take an aspirin for your headache, taking the aspirin is a negative reinforcer whereas the headache is an operant.