There is a statement by professor in class that every vector $\vec p$ could be decomposed to whatever other two vectors $\vec u$ and $\vec v$ for which ${\vec u \times \vec v \neq 0}$. So they are not collinear.
The decomposition is stated it represents: $$\vec p = \frac{(\vec p \times \vec v)\vec u +(\vec u \times \vec p)\vec v}{\vec u \times \vec v}$$
Which is stated to come from the equation $$\vec p = k \vec u+l\vec v$$ (seems to me the parallelogram law) by doing cross product on both sides with ${\times \vec v}$ and ${\vec u \times }$, where k and l are constants.
What I happened to get to is the following equations: $$\vec p \times \vec v = (k \vec u+l\vec v) \times \vec v=k(\vec u \times \vec v)+l(\vec v \times \vec v)=k(\vec u \times \vec v)+0$$
$$\vec u \times \vec p = \vec u\times(k \vec u+l\vec v) =k(\vec u \times \vec u)+l(\vec u \times \vec v)=l(\vec u \times \vec v)+0$$
It is added that if $\vec v$ is the perpendicular of $\vec u$, then the equation will be $$\vec p=( \hat u \cdot \vec p )\hat u + ( \hat u \times \vec p )\hat v$$, which comes from the properties of the vector operations.
I don't understand how does it come from the equation and where do the constants go and why do they appear in the first place? Would appreciate the help and resources to relevant additional information.

Given $\vec u$ and $\vec v$ not collinear they are a basis therefore for some $k$ and $l$ we have
$$\vec p = k \vec u+l\vec v$$
then we are stating that
$$\vec p = \frac{(\vec p \times \vec v)\vec u +(\vec u \times \vec p)\vec v}{\vec u \times \vec v}$$
since
$$\vec p \times \vec v = (k \vec u+l\vec v) \times \vec v=k(\vec u \times \vec v)+l(\vec v \times \vec v)=k(\vec u \times \vec v)+\vec 0=k(\vec u \times \vec v)$$
$$\vec u \times \vec p = \vec u\times(k \vec u+l\vec v) =k(\vec u \times \vec u)+l(\vec u \times \vec v)=\vec 0+l(\vec u \times \vec v)=l(\vec u \times \vec v)$$
and then
$$\require{cancel} \vec p = \frac{(\vec p \times \vec v)\vec u +(\vec u \times \vec p)\vec v}{\vec u \times \vec v}=\frac{k\cancel{(\vec u \times \vec v)}\vec u+l\cancel{(\vec u \times \vec v)}\vec v}{\cancel{\vec u \times \vec v}}=k \vec u+l\vec v$$
and in this way the identity works.
For the final part, it is stated is that when $\vec u$ and $\vec v$ are perpendicular we can also refer to
$$\vec p=( \hat u \cdot \vec p )\hat u + ( \hat u \times \vec p )\hat v$$
with
$$\hat u \cdot \vec p =\hat u \cdot ( k \vec u+l\vec v)=k|u|+0=k|u|$$
$$\hat u \times \vec p =\hat u \times ( k \vec u+l\vec v)=0+l|v|=l|v|$$
and therefore
$$\vec p=( \hat u \cdot \vec p )\hat u + ( \hat u \times \vec p )\hat v=$$
$$=k|u|\hat u+l|v|\hat v=k\vec u + l \vec v$$