Do orthogonal projections play a role in diagonalizability?
$T$ being the orthogonal projection means two things:
$$Tw = w \quad \forall w\in W$$ $$Tw = 0 \quad \forall w\in W^\perp$$
Here, $W^\perp$ means the orthogonal complement to $W$. By construction, $v_1,\dots,v_k \in W$ and $v_{k+1},\dots,v_n \in W^\perp$. Finally, a matrix of a linear transformation $T$ is defined by how it acts on the basis $v_1,\dots,v_n$.
$\{v_1,...,v_k\}$ is an orthonormal basis of $W$ and $\{v_{k+1},...,v_n\}$ is an orthonormal basis of $W^{\perp}$ .
Furthermore we have $Tv=v$ for all $v \in W$ and $Tv=0$ for all $v \in W^{\perp}$ .
Hence
$Tv_j=v_j$ for $j=1,...,k$ and $Tv_j=0$ for $j=k+1,...,n$.