Easy to prove when you find the right theorem.
In the GR background, let's consider $g_{ab}$ in orthonormal basis being (-+++) signature.
Theorem 1. Consider a hypersurface $Σ$ in manifold $(M,g_{ab})$, with unit normal vector field on it denoted as $n^a$, then it's induced with a natural metric $h_{ab}$ on $Σ$:
$$
h_{ab}=g_{ab}+n_an_b
$$
Theorem 2. Relation between the covariant derivative $∇_c$ of $M$ and that of the hypersurface $\mathrm D_c$: Consider acting on any arbitrary tensor field $T^{a_1\cdots a_k}{}_{b_1\cdots b_l }$ on $Σ$.
$$
\mathrm D_cT^{a_1\cdots a_k}{}_{b_1\cdots b_l }=h^{a_1}{}_{d_1}\cdots h^{a_k}{}_{d_k}
h_{b_1}{}^{e_1}\cdots h_{b_l}{}^{e_l} h_c{}^f
∇_f T^{d_1\cdots d_k}{}_{e_1\cdots e_l }.
$$
Now let's prove the geodesic w.r.t $M$ must be also geodesic w.r.t $Σ$. Set tangent vector as $w^a$. Then we have $w^b∇_bw^a=0$. Let's check it $\Rightarrow$ $w^bD_bw^a=0$:
$$
w^b\mathrm D_bw^a=
{h^a}_α\underline{{h^β}_bw^b}∇_βw^α={h^a}_α\underline{w^β∇_βw^α}=0
$$
in which the second step using $w^b$ stay unchanged after $h^β{}_{b}$ projection. Q.E.D.