The technique involved in the first question is known as orthogonal projection. The rough idea is that we "cast a shadow" of $\vec u$ onto the line generated by $\vec v,$ and call that shadow vector $\vec w_1,$ then let $\vec w_2=\vec u-\vec w_1,$ and the desired properties will be satisfied.
To do this, we find the portion of $\vec u$ that is parallel to $\vec v$. First, we take the dot product $$\vec u\cdot \vec v=3-8=-5.$$ This is simply $\lVert \vec u\rVert\lVert\vec v\rVert\cos\theta,$ where $\theta$ is the angle between the directions of the two vectors. All we really want is a vector of magnitude $\lVert \vec u\rVert|\cos\theta|$ in a direction along the line generated by $\vec v,$ though. To compensate for this, we find $\vec v\cdot\vec v=9+16=25,$ and let $$\vec w_1=\frac{\vec u\cdot\vec v}{\vec v\cdot\vec v}\vec v=\frac{-5}{25}\langle 3,-4\rangle=\left\langle-\frac35,\frac45\right\rangle.$$ This is readily confirmed to be parallel to $\vec v$, and as desired, we have $$\lVert\vec w_1\rVert=\left\lVert\frac{\lVert \vec u\rVert\lVert \vec v\rVert\cos\theta}{\lVert \vec v\rVert\lVert \vec v\rVert}\vec v\right\rVert=\frac{\lVert \vec u\rVert|\cos\theta|}{\lVert \vec v\rVert}\lVert \vec v\rVert=\lVert \vec u\rVert|\cos\theta|.$$ Then, letting $\vec w_2=\vec u-\vec w_1,$ we have $\vec u=\vec w_1+\vec w_2$ by definition, and $$\begin{align}\vec w_2\cdot\vec v &= \vec u\cdot\vec v-\vec w_1\cdot\vec v\\ &= \vec u\cdot\vec v-\frac{\vec u\cdot\vec v}{\vec v\cdot\vec v}\vec v\cdot\vec v\\ &= \vec u\cdot\vec v-\vec u\cdot\vec v\\ &= 0,\end{align}$$ so $\vec v\perp\vec w_2.$
For your second question, try writing $$A=(a_1,...,a_n)\\B=(b_1,...,b_n)\\C=(c_1,...,c_n)\\D=(d_1,...,d_n)$$
Then, for example, we have $$\vec{AB}=\langle b_1-a_1,...,b_n-a_n\rangle\\\vec{CD}=\langle d_1-c_1,...,d_n-c_n\rangle$$ See if you can use this with the definition of dot product to prove the identity.