Let's look at the points (4, 5) and (6, 2) for example.
We can make a right triangle out of these points like this...
Notice that side c is the distance between the two points.
And..we can find the length of side c using the Pythagorean theorem, which says..
a2 + b2 = c2
The length of side a = 5 - 2 = 3
(5 - 2)2 + b2 = c2
The length of side b = 6 - 4 = 2
(5 - 2)2 + (6 - 4)2 = c2
Take the positive square root of both sides.
\(\sqrt{(5-2)^2+(6-4)^2}=c\)
And this is where the distance formula comes from. It says..
\(\text{distance}=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}\)
And, as CPhill noted, the order of subtraction within the parenthesees doesn't matter.