Post hoc reasoning is the fallacy where we believe that because one event follows another, the first must have been a cause of the second. In some cases this is true, but other factors may be responsible.
Good science must always try to uncover other reasons, with causal reasoning a powerful method for eliminating unlikely causes.
Imagine that you are ill after eating fish at a restaurant. You automatically assume that the fish was to blame for your illness.
In reality, it might not have been the seafood; you ate and drank other foods, too. The plate may have been dirty or the sickness may have been caused by something you ate in the morning.
You have a bad cold and take a well known remedy. A few days later, you feel better and, through post hoc reasoning, you are convinced that the remedy worked. Cheerfully, you resolve to buy that medicine the next time you have a cold.
The problem is that you may have recovered, just as quickly, without that medicine. The remedy may even have caused you to take longer to get better; there really is no way of knowing.
Science always tries to look at all of the possible causes and, whilst the abductive reasoning process often leads to the simplest, that does not always mean that it is the definite cause. Causal reasoning is often used to judge the quality of information and generate reasonable hypotheses.
In the cold remedy example, imagine a friend had the same sickness but took no medicine, and took much longer to recover. He has acted as a control and causal reasoning allows you to make a tentative assumption that the remedy worked.
A good researcher must still take into account other factors; maybe your friend has a weaker immune system or smokes too many cigarettes. The reasoning process has led you to a reasonable hypothesis and helped you avoid post hoc reasoning, but you still need to test the hypothesis comprehensively.
This is why any true scientific design must use include controls to make sure that any other possible causes of the final effect are ruled out and eliminated so that only the variable being tested is able to influence the results.
If an effect follows a cause, it may be a link worth investigating, but may not be the only contributing factor. It may not be linked at all.