In a nutshell
Linear regression draws the single straight line that best follows a cloud of points, so you can predict one quantity from another. 'Best' means the line with the smallest average squared vertical gap to the points; you find it either with an exact formula or by gradient descent, nudging the line downhill on that error.