Explanation:
2 points on a coordinate grid establish a right-angled triangle.
the direct distance between them is the Hypotenuse (the side opposite of the 90° angle), and the x- and y-coordinate differences are the legs.
so, we can use Pythagoras
c² = a² + b²
with c being the Hypotenuse, and a and b being the legs.
PQ² = (3 - 6)² + (4 - 8)² = (-3)² + (-4)² = 9 + 16 = 25
PQ = sqrt(25) = 5
FYI - because of the squaring it does not matter which point gets subtracted from which point when calculating the coordinate differences. we could have done (6-3)² and (8-4)² with the same result.