Having difficulty with a proof - distance from a point to a line

Hey!

I am having trouble proving something, and I was hoping someone here could help me out!

** Question **

Prove that the distance from a point Q in space to a line through a point P with direction vector d is equal to .

** Solution **

What I have learned about this topic so far is: to find the smallest distance from a point to a line you find the equation of a line that passes through the point and is perpendicular to the line.

I really have no idea where to start with this proof, any help is greatly appreciated!