In the table below, we list the public debt D of the United States (in billions of dollars), in various years.
Year 1985 1995 2005 2015
D 1823 4974 7933 18151
(a) Letting $t = 0$ in 1985, fit a linear function of the form $\log(D) = c_0 + c_1t$ to the data points $(t_i, \log(D_i))$, using least squares.
(b) Use the result of (a) to fit an exponential function to the data points $(t_i, D_i)$. What debt does your formula predict for 2025?

This can be set up as a matrix equation $$ \underbrace{\left [ \begin{array}{cc} 1 & 1985 \\ 1 & 1995 \\ 1 & 2005 \\ 1 & 2015 \\ \end{array} \right ]}_{=A}\underbrace{\left [ \begin{array}{c} c_0\\ c_1 \\ \end{array} \right ]}_{=x} \;\; =\;\; \underbrace{\left [ \begin{array}{c} \log(1823) \\ \log(4974) \\ \log(7933) \\ \log(18151) \\ \end{array} \right ]}_{=b}. $$
Then the standard way to solve for the weight $c_0$ and $c_1$ is through:
$$ x \;\; =\;\; \left (A^TA\right )^{-1}A^Tb. $$
Linear least squares is covered in a lot of different places. Take this for example.