vec r_2 is the position vector of P . Find 1^° the distance…
$\vec r_2$ is the position vector of $P$. Find $1^\circ$ the distance from $P$ to the plane $(\vec r-\vec r_1)\cdot\vec a=0$, and $2^\circ$ the position vector $\vec r_0$ of the foot of the perpendicular from $P$.
Explanation of Method
Distance from a point to a plane and the foot of the perpendicular, both in vector form.
Step 1: $1^\circ$ Distance
The plane passes through $\vec r_1$ with normal $\vec a$. The distance is the length of the projection of $\vec r_2-\vec r_1$ onto $\vec a$: $d=\frac{|(\vec r_2-\vec r_1)\cdot\vec a|}{|\vec a|}$.
In coordinates this is the usual formula $\frac{|Ax_2+By_2+Cz_2-(Ax_1+By_1+Cz_1)|}{\sqrt{A^2+B^2+C^2}}$.
Step 2: $2^\circ$ Foot of the perpendicular
The normal line is $\vec r=\vec r_2+t\vec a$. Substituting into the plane gives $(\vec r_2-\vec r_1)\cdot\vec a+t|\vec a|^2=0$, so
\[\vec r_0=\vec r_2-\frac{(\vec r_2-\vec r_1)\cdot\vec a}{|\vec a|^2}\,\vec a\]
Checks: $(\vec r_0-\vec r_1)\cdot\vec a=(\vec r_2-\vec r_1)\cdot\vec a-(\vec r_2-\vec r_1)\cdot\vec a=0$. Also $|\vec r_2-\vec r_0|=d$. $\checkmark$
Result
\[\boxed{\,d=\frac{|(\vec r_2-\vec r_1)\cdot\vec a|}{|\vec a|}\,}\]
\[\boxed{\,\vec r_0=\vec r_2-\frac{(\vec r_2-\vec r_1)\cdot\vec a}{|\vec a|^2}\,\vec a\,}\]