It depends on what you can use as tools. (For example, what is the definition of a "distance"? Can we use vectors or the complex plane? etc.)
The easiest way would be to use the Cauchy-Schwarz inequality: .
We have to minimize (x-x_1)^2+(y-y_1)^2 where ax+by+c=0.
By the above inequality, . Substitute ax+by=-c into this and you get the formula.
Let B(x_0, y_0) be the point on the line realizing the distance: d=AB. If you know that AB is perpendicular to the line, there are many more proofs.For example, the line AB is -b(x-x_1)+a(y-y_1)=0, so you can determine B with the condition ax_0+by_0+c=0. (You can rephrase this by using vectors and saying that (x-x_1, y-y_1) is parallel to (a, b).)
If you know trigonometrics, represent any point on the line by As it is on the line, which is for some . The minimum of r is attained when is either 1 or -1.