I have the matrix $\mathbf{P} = \boxed{\begin{pmatrix} 4/5 & -2/5 \\ -2/5 & 1/5 \end{pmatrix}}.$
How do I use the matrix $\mathbf{P}$ to figure out $\mathbf{w}_1$ and $\mathbf{w}_2$ in the diagram below
Could someone please show me how they get w2?(or w1)

There is a vector formula for the orthogonal projection onto a vector: if $\langle\cdot,\cdot\rangle$ denotes the inner product, then
$$\text{proj}_u(v)=\frac{\langle u,v\rangle}{\langle u,u\rangle}\,u.$$