Data Fitting and Uncertainty: A practical introduction to weighted least squares and beyond