Having the actual graph is an easy way to calculate the equation of the line. Since the format is y = mx +b we just need to plug in numbers.
b = y-intercept
m = slope
We can automatically see that the y-intercept is 2, so b = 2. To find the slope we just calculate rise over run. The line is decreasing 1 unit for every 4 units it is "running". Therefore, -1/4 is your slope.
The equation would be y=-1/4x+2 because the rise is -1 and the run is 4 (you could also say the run is -4 and the rise is 1. It doesn't really matter). The line also crosses the y axis at 2, which means that 2 is the y-intercept. :)