In order to know the distance from the number line we just subtract the smaller number from the bigger number.
So we can get 7-(-2)=7+2=9
Or we can list the numbers and imagine them on the number line so:
-2, -1, 0, 1, 2, 3, 4, 5, 6, 7
We can count the spaces and get 9 as well