The x-value at the y-intercept is 0. The y-value there is 2. As the x-value increases by 1 unit to x=1, the y-value decreases by 1 unit to y=1. Thus, the slope is -1, and the slope-intercept form of the equation can be written as
... y = -x + 2
Subtracting the right side puts the equation into general form.
... x + y - 2 = 0