The Pythagorean theorem states that for any right triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides. It is used to calculate the length of the hypotenuse or other sides of a right triangle when the other two lengths are known. The distance formula gives the distance between two points by taking the square root of the sum of the squared differences between their x- and y-coordinates.