Let $$ ax + by + cz + d = 0$$ be equation of a plane and
$$\frac{x-x_1}{a_1} = \frac{y-y_1}{b_1} = \frac{z-z_1}{c_1} $$ be equation of a line.
How to find the distance between a point say $(x_2,y_2,z_2)$ and the given line measured parallel to the given plane?
What should be the approach?
We have $P (x_2, y_2, z_2)$ and let $Q(x, y, z) $ be the point on the line given. Then we have $Q(x,y,z) =Q(a_1k +x_1, b_1k + y_1, c_1k + z_1) $ where $k$ is a constant.
We need the line $PQ $ to be parallel to the plane $\pi: ax+by+cz +d=0 $. If this line $PQ$ is parallel to the plane then its direction vector must be perpendicular to the plane's normal vector.
The direction vector normal or perpendicular to the plane $ax + by +cz + d= 0$ is $D (a, b, c)$. Now, if two vectors are perpendicular then their scalar or dot product is zero. Therefore $D$ and $PQ$ are perpendicular to each other.
Thus we solve for $k $ in the equation $$a (a_1k +x_1-x_2) +b (b_1k + y_1-y_2) + c (c_1k + z_1-z_2) =0$$ and find the point $Q $ and find the distance. Hope it helps .