Many writers wonder if it’s equally correct to use “will” or “would” in an if-clause. The short answer is no, but there are exceptions to the rule.
The action in this sentence is the aspirin easing the headache, which will take place only after the speaker takes them later that night.
Another exception is when “will” is not being used as an auxiliary verb, but as a modal verb. In other words, “will” is permitted when it is being used to politely express willingness, persistence or a wish. For example, consider the following sentence:
The speaker will only warm up the water if he is excused by the listener.