slope m = (y2-y1)/(x2-x1)
( 0 - 2 )/( 4 - 0 )
( -2 / 4 )
m= - 1/2
The required line passes through both the points. So we select one point and plug it with the slope
Plug value of the slope and point ( 0 , 2 ) in
Y = m x + b
2.00 = - 1/2 * 0 + b
2.00 = -0 + b
b= 2 + 0
b= 2
So the equation will be
Y = - 1/2 x + 2