This theorem is only used for right-angled triangles.
In a right-angled triangle, there is always one 90º angle and the sum of the other two angles is always to 90º

The side opposite the 90º is always the longest side. The longest side is called the hypotenuse In the triangle above, ∠CAB = 90º

We know sum of all angles of a triangle = 180º
∠CAB + ∠ACB + ∠CBA = 180º
Since ∠CAB = 90º,
90 + ∠ACB + ∠CBA = 180º
∠ACB + ∠CBA = 90º
Since ∠CAB = 90º, the side opposite ∠CAB (i.e. CB) is the hypotenuse.
According to Pythagoras’ Theorem,
Hypotenuse² = (2nd side)² + (3rd side)²

Using the above triangle as an example, we can form the equation:
CB² = AB² + AC²
If we have the value of AB and AC and we want to find the value of CB, we do the following:
CB = √(AB² + AC²)

If we have the value of CB and AC and we want to find the value of AB, we rearrange to get the following:
CB² – AC² = AB²
AB = √(CB² – AC²)

If we have the value of CB and AB and we want to find the value of AC, we rearrange to get the following:
CB² – AB² = AC²
AC = √(CB² – AB²)