Using:
y = mx + c, where c = vertical intercept = y intercept = 2
y = mx + 2
x intercept is the value of x, when y = 0, if x intercept is = -1, means the point is (-1 , 0)
This point (-1 , 0) satisfies the equation y = mx + 2
x = -1, y = 0
y = mx + 2
0 = m*(-1) + 2
0 = -m + 2
0 + m =2
m = 2
So for:
y = mx + 2
y = 2x + 2
So the equation is y = 2x + 2
I hope this explains it.