First let us find the slope:
Points (x , y) = (-2 , 1) and (5 , 8)
Slope m = (y₂ - y₁)/(x₂ - x₁) = (8 - 1) / (5 - -2) = 7/(5 + 2) = 7/7 = 1
Slope m = 1.
Equation of a line by point slope form y - y₁ = m(x - x₁)
Using the point (5, 8) x₁ = 5, y₁ = 8, m = 1
y - y₁ = m(x - x₁)
y - 8 = 1(x - 5)
y - 8 = 1*(x - 5) Point slope form of equation
But let's just simplify further
y = x - 5 +8
y = x + 3
Equation is also y = x + 3
Hope this helps.