First Method.
You are given that the line goes through (0,−6) and (−1,−4) and the equation of the line is of the form y=ax+b
Hence:
1) At x=0 we have y=−6, and this gives −6=a×0+b=b on putting x=0 into y=ax+b.
So b=−6.
2) At x=−1 we have y=−4, and this gives −4=a×(−1)+b=−a−6 on putting x=−1 into y=ax+b.
On rearranging we obtain a=4−6=−2.
So a=−2.
So the equation of the line is y=−2x−6.
Second Method.
The equation y=ax+b tells us that the graph crosses the y-axis (when x=0) at y=b.
So looking at the graph we immediately see that b=−6.
a is the gradient of the line and is given by the change from (−1,−4) to (0,−6):
a=Change in yChange in x=6−4−1−0=−2