Answer:
Short answer: They are essentially the same thing.
The distance formula is derived from the Pythagorean Theorem
We have distance formula:

Pythagorean Theorem:

The shortest distance between two points if a line. If you draw a line in the cartesian plane both points will have an x-coordinate and y-coordinate. Note that it forms a right triangle! Therefore, the distance between those points is the hypotenuse.
We can have a point
and point
But once
and
can be positive or negative:
