Proof 2 (Taylor's theorem with Lagrange and Cauchy remainder)
Again WLOG assume $a=0$. For $0\leq t\leq h$, let $$ F(t) = f(h) - f(t) - (h-t)f'(t) - \frac{(h-t)^2}{2!}f''(t) - \ldots - \frac{(h-t)^{n-1}}{(n-1)!} f^{(n-1)}(t). $$ We do this because $F$ is continuous on $[0,h]$, differentiable on $(0,h)$, and using product rule, $$\begin{align*} F'(t) =& -f'(t) \\ &+\Big(f'(t) - (h-t)f''(t)\Big) \\ &+\Big((h-t)f''(t) - \frac{(h-t)^2}{2!}f'''(t)\Big) \\ &\vdots \\ &+\Big(\frac{(h-t)^{n-2}}{(n-1)!}f^{(n-1)}(t) - \frac{(h-t)^{n-1}}{(n-1)!} f^{(n)}(t)\Big) \\ =&- \frac{(h-t)^{n-1}}{(n-1)!} f^{(n)}(t). \end{align*}$$
Now to apply Rolle's theorem, there are many ways to make $\phi(0)=\phi(h)$. In particular, for any $p\in\N$ with $1\leq p<n$, $$ \phi(t) = F(t) - \Big(1-\frac th\Big)^p F(0)$$ then we'll get $\phi(0)=\phi(h)=0$.
So by Rolle's theorem, there exists $\theta\in(0,1)$ such that $$\begin{align*} 0 =&\ \phi'(\theta h) \\ =& -\frac{(1-\theta)^{n-1} h^{n-1}}{(n-1)!} f^{(n)}(\theta h) \\ &+ \frac{p(1-\theta)^{p-1}}h \Big(f(h)-f(0)-hf'(0)-\frac{h^2}{2!}f''(0) - \ldots - \frac{h^{n-1}}{(n-1)!}f^{(n-1)}(0)\Big) \end{align*}$$ so $$ f(h) = f(0) + hf'(0) + \frac{h^2}{2!}f''(0) + \ldots + \frac{h^{n-1}}{(n-1)!} f^{(n-1)}(0) +\frac{(1-\theta)^{n-p} h^n}{p(n-1)!} f^{(n)}(\theta h).$$
Setting $p=n$ gives Lagrange remainder; $p=1$ gives Cauchy remainder.