Check the picture below.
to graph a LINEar equation, since it's just a line and for a line all you need is two points and draw away, simply pick two random "x" values to get the "y" values and plot those two points.
for y = -x + 2
if we choose x = 0, then y = -0 + 2 => y = 2, that gives us the point (0 , 2)
if we choose x = 2, then y = -2 + 2 => y = 0, that gives us the point (2 , 0)
graph it and we get the blue line.
for the 2nd equation
graph it and we get the red line
notice, those points are in those lines, and to graph a LINE, all you need is two points.