A residual is the vertical distance from a point to the line. Squaring prevents positive and negative residuals from canceling. The best-fit line minimizes their total. Totals are measured with the graph's height as one unit, so data sets can be compared.