So to find this we can to the rise over run to get the slope.
4 - 2 = 2 (run) and 8 - 2 = 6 (rise)
6 over 2 is also 6 divided by 2, so the slope is 3.
Next, to find the y-intercept we take the first point of (2,2) and multiply 2(the x) by 3(the slope) which is 6, then we subtract 6(that number) from 2(the y) to get -4, the y-intercept!
The last step to this is to put the equation together.
y = -4 + 3x
Hope this helps!