Consider the following simple linear regression model involving the $\epsilon_i$ error term,
$$y_i = \alpha + \beta x_i + \epsilon_i$$
such that,
$$\epsilon_i \sim \mathcal N(0,\sigma^2)$$
we know that if $Z_1, Z_2, ..., Z_n$ are independent, standard normal random variables,
$$Z_i \sim \mathcal N(0,1)$$
then the sum of their squares is distributed according to the chi-square distribution with $n$ degrees of freedom,
$$\sum _{i=1}^{n} Z_{i}^{2} \sim \chi^{2}_{n}$$
Now let's prove that $\frac{(n-2)s^2}{\sigma^2}\sim \chi^{2}_{n-2}$ such that,
$$s^2 = \frac{\sum _{i=1}^{n} \hat{\epsilon}_i^2}{n-2}$$
Proof:
$\require{cancel}$
$$\epsilon_i \sim \mathcal N(0,\sigma^2)$$
$$\frac{\epsilon_i - \cancelto{0}{\overline{\epsilon}}}{\sigma} \sim \mathcal N(0, 1)$$
$$\sum _{i=1}^{n} \left(\frac{\epsilon_i}{\sigma}\right)^2 \sim \chi^{2}_{n}$$
$$\sum _{i=1}^{n} \frac{\epsilon_i^2}{\sigma^2} \sim \chi^{2}_{n}$$
How do I now move from this expression $\sum _{i=1}^{n} \frac{\epsilon_i^2}{\sigma^2}$ which uses the error term $\epsilon_i$ to this expression $\sum _{i=1}^{n} \frac{\hat{\epsilon}_i^2}{\sigma^2}$ which uses the residual term $\hat{\epsilon}_i$?
Note:
I came across this answer but I got lost in the second part of the demonstration and I wanted to know if there is a simpler method that would lead to the same answer.