Let $X$ be an inner product space and $\{x_1,....,x_{n}\}$ be orthonormal prove $\bigg|\bigg| x- \sum_{k=1}^{n} c_kx_k\bigg|\bigg|$ is minimized by $c_n=(x,x_{n})$
Thoughts since $x_k$'s are orthonormal $c_kx_k$ are orthogonal and $\{x_1,....,x_{n},x-\sum_{k=1}^{n} c_kx_k\}$ is orthonormal. I'm not really sure what to do now I tried applying Pythagoras theorem Bessel’s inequality but couldn't seem to get anywhere.
Let $W$ be the subspace spanned by the $x_k$'s and fix $x\in X$. We can interpret your problem as trying to prove that the minimum of $\Vert x-w\Vert$ as $w$ ranges through $W$ occurs when $w=z$ where $z:=\sum_{k=1}^n\langle x,x_k\rangle x_k\in W$.
Observe that, by Pythagoras, we have $$\Vert x-w\Vert^2=\Vert x-z\Vert ^2+\Vert z-w\Vert^2\qquad\forall w\in W$$ since $x-z$ is orthogonal to $W$ and $z-w\in W$. Therefore, minimizing $\Vert x-w\Vert^2$ as $w$ ranges through $W$ is equivalent to minimizing $\Vert x-z\Vert^2+\Vert z-w\Vert^2$ as $w$ ranges through $W$. The minimum of the latter clearly occurs when $\Vert z-w\Vert^2=0$, i.e. $z=w$.