The distance formula and the Pythagorean theorem are really just the same thing. Recall that the Pythagorean theorem allowed you to calculate the hypotenuse, c of a right triangle from the lengths of the other two sides, a and b:
c = [a2+b2]1/2
Think about a piece of graph paper. The x and y axes are always perpendicular, yes? So any line segment on that paper can be thought of as the hypotenuse of a right triangle, with the sides parallel to the x and y axes.
So the length of the line segment, d, is "the square root of the sum of the squares of the other two sides":