The Pythagorean theorem is used to calculate the length of the hypotenuse of a right triangle using the lengths of the other two sides. The distance formula calculates the distance between two points in a plane by taking the square root of the sum of the squared differences between their x- and y-coordinates. Examples are provided to demonstrate how to apply the Pythagorean theorem to solve for the length of one side of a right triangle and how to use the distance formula to calculate the distance between two points.