You have to know that the equation of a line is like : y = mx + p
Use the formula : (Y2 - Y1)/ (X2 - X1) to find the letter "m" (the slope).
It would give :
(-2 -7)/ (8 - (-1))
= -9/9 = -1
So y = -x + p
Then :
7 = -(-1) + p
7 - 1 = p
6 = p
Therefore, the equation would be y = -x + 6.
Hope this helps !
Photon