2x = 10 - y
y - x = -2 ---> (solve for y) ---> y = x - 2
Replace this into the other equation: 2x = 10 - (x - 2)
(distribute) 2x = 10 - x + 2
(add x to both sides) 3x = 12
(divide by 3) x = 4
Replace this into the equation y = x - 2 ---> y = 4 - 2 ---> y = 2