The distance formula is a formalisation of the Pythagorean Theorem using (x,y) . They are the same thing (but the distance formula is for working out the distance between two points and Pythagoras theorem is for working out the missing length in a right-angled triangle) in two different contexts.
Both formulas can be used to find the distance between two points on the coordinate plane. The vertical leg of the right triangle represents the difference in the y values of the two points. The horizontal leg of the right triangle represents the difference in the x values of the two points. The hypotenuse of the right triangle represents the distance between the two points.