If a line is given by $\vec{p}\cdot\vec{n}=d$ where $\vec{p}=(x,y)$ is a point on the line, then $\vec{n}$ is the unit normal vector to the line (perpendicular direction) and $d$ is the minimum distance to the origin. For your case you have $ \vec{p}\cdot(0.3511,0.9263)=6 $, but unfortunately $\vec{n}$ is not a unit vector here. To make it a unit vector you have
$$ \vec{p}\cdot(0.3544,0.9351)=6.0569 $$
with $\vec{n}=(0.3544,0.9351)$ and $ d=6.0569 $. The distance between the point P and the closest point to the line is the perpendicular projection of the difference between P and A where is any point on the line. I choose the point A with coordinates $\vec{a}=\vec{n}\,d=(2.1467,5.6637)$ representing the closest point of the line to the origin. The distance of P with the line is $r=\vec{n}\cdot(\vec{p}-\vec{a})$ or
$$ r = \vec{n}\cdot\vec{p}-d $$
with $r = 16.189 $ for P=(10,20).
The point P' closest to the line is offset from P by $r$, with the equation $\vec{p}'=\vec{p}-\vec{n}\,r = \vec{p}-\vec{n}(\vec{n}\cdot\vec{p}-d) $, or
$$ \vec{p}' = \vec{p}-(\vec{n}\cdot\vec{p}-d)\vec{n} $$
with $\vec{p}'=(4.2621,4.8619)$
Here is the checks I did with GeoGebra.
So proceed similarly with point Q = (4,3) to get Q' and the distance between P' and Q' as 0.415
Hint: Minimizing the distance is equivalent to minimizing the square of the distance. Remove that square root sign. You get a harmless quadratic.
So I would write "equivalently, we minimize the square of the distance $\dots$. "
The calculation can be done without removing the square root sign, but the probability of mechanical error increases markedly.
Best Answer
One point on the line is $(-2, -4, 5)$ and another is $(0,0,1)$ (found by setting the equation to 0, then to 2). So the general point is $(-2t, -4t, 1+4t)$. You want the dot product of the vector from a point on the line to $(1, 1, 1)$ and a vector along the line to be zero. So $$(-2, -4, 4)\cdot(-2t-1, -4t-1, 4t)=0$$ $$4t+2+16t+4+16t=0$$ $$t=\frac{-1}{6}$$ And the point is $$\left(\frac{1}{3},\frac{2}{3},\frac{1}{3}\right)$$