Finding vector b orthogonally

we seek the $b$ for which

$$ || \mathbf{e} || = \sqrt{\mathbf{e’e}} = || \mathbf{y – Xb} ||$$
is smallest. The vector $\mathbf{e}$ that is ORTHOGONAL to $\mathbf{Xb}$ is the unique vector that makes $\mathbf{b}$ a minimum, such that $\mathbf{Xb}$ is a minimum and close to $\mathbf{y}$. Recall that if two non-zero vectors $\mathbf{a}$ and $\mathbf{b}$ are orthogonal i.e. $\mathbf{a} \perp \mathbf{b}$ it implies that\begin{align*}
\mathbf{a’b} &= \mathbf{b’a = 0}\end{align*}
So in this case,
\begin{align*}\mathbf{e} &\perp \mathbf{Xb} \text{ means}
\mathbf{(Xb)’e} = 0,\\
&=\mathbf{(Xb)'(y-Xb)} = 0,\\
&=\mathbf{b’X’y – b’X’Xb = 0,}\\
\mathbf{X’y} &= \mathbf{X’Xb} \quad (\text{as long as} \quad b \neq 0)
\end{align*}
\begin{equation*}
\Rightarrow \qquad
\boxed{\large\widehat{\beta} = (X’X)^{-1} X’ y}
\end{equation*}