Find the slope first, use the formula (y₁-y₂)/(x₁-x₂)
[6-(-2)]/(-1-7) = 8/-8 -> -1 Therefore your slope (mx) is -x.
To find the y-intercept, you use one of the points and substitute it in the slope intercept formula: y=mx+b, using the slope you just found.
-2=-1(7)+b
-2=-7+b -> -2+7=b
b=5
In conclusion, your equation will be y=-x+5. I hope this helped ;)