Assuming the errors are i.i.d $N(0,\sigma^2)$ with $\sigma$ unknown.
The mean response at $x=x_0$ is $$E(y\mid x_0)=\beta_0+\beta_1x_0$$
We estimate $E(y\mid x_0)$ from the fitted model by $$\hat\mu_{y\mid x_0}=\hat\beta_0+\hat\beta_1x_0$$
Show that
\begin{align}
\operatorname{Var}(\hat\mu_{y\mid x_0})&=\operatorname{Var}(\hat\beta_0)+x_0^2\operatorname{Var}(\hat\beta_1)+2x_0\operatorname{Cov}(\hat\beta_0,\hat\beta_1)
\\&=\sigma^2\left[\frac{1}{n}+\frac{(x_0-\bar x)^2}{S_{xx}}\right]
\end{align}
, where $S_{xx}=\sum\limits_{i=1}^n (x_i-\bar x)^2$ as usual.
Since $\sigma$ is not specified, the estimated standard error of $\hat\mu_{y\mid x_0}$ is $$\text{S.E.}=\hat\sigma\sqrt{\frac{1}{n}+\frac{(x_0-\bar x)^2}{S_{xx}}}$$, where $\hat\sigma^2=\frac{1}{n-2}\sum\limits_{i=1}^n(y_i-\hat\beta_0-\hat\beta_1 x_i)^2$ is the residual variance.
Since $(\hat\beta_0,\hat\beta_1)$ is jointly normal, we have $$\frac{\hat\mu_{y\mid x_0}-E(y\mid x_0)}{\sigma\sqrt{\frac{1}{n}+\frac{(x_0-\bar x)^2}{S_{xx}}}}\sim N\left(0,1\right)$$
The above again is independent of $$\frac{(n-2)\hat\sigma^2}{\sigma^2}\sim \chi^2_{n-2}$$
So you have the pivot $$\frac{\hat\mu_{y\mid x_0}-E(y\mid x_0)}{\hat\sigma\sqrt{\frac{1}{n}+\frac{(x_0-\bar x)^2}{S_{xx}}}}\sim t_{n-2}$$
Hence a $100(1-\alpha)\%$ confidence interval for $E(y\mid x_0)$ has confidence limits $$\hat\mu_{y\mid x_0}\mp (t_{\alpha/2,n-2})\hat\sigma\sqrt{\frac{1}{n}+\frac{(x_0-\bar x)^2}{S_{xx}}}$$
Relevant threads (also check out the linked posts):