If the line is linear, you can form a right triangle. If you subtract the initial values from the final, you’ll get the change in y and the change in x. That’s essentially the formula for displacement. Then to find the hypotenuse, you have to sum the squares and then take the square root of that. That’s straight from Pythagorean’s theorem.
Find the displacement of y:
2 - 2 = 0
Find the displacement of x:
3 - (-3) = 6
sqrt of 6^2 + 0^2 is just the sqrt of 36 which is 6