A common goal in science is to use knowledge gained by observing a phenomenon of interest to guide decision and policy making. If smokers are observed to have higher rates of lung cancer, should we legislate to discourage smoking? Such a policy will only be effective if smoking itself is the cause of cancer and the correlation between cancer rate and smoking is not explained by other factors, such as lifestyle choices. Problems like these are well described in the language of causal inference. In this primer, we explain the difference between statistical and causal reasoning, and introduce the notions of confounding, causal graphs and counterfactuals. We cover the problem of estimating causal effects from experimental and observational data, as well as sufficient assumptions to make causal statements based on statistical quantities.