To answer this, you should "subtract" x+y=7 from 3x+y=45.
What is left is 2x=38, where x then equals 19.
Plug this value into any of the equations (I will choose x+y=7 for simplicity).
19+y=7, y=-12
Check this answer by plugging it into the other equation.
3(19) + (-12) =45
45=45 so it is correct
X=19 and Y=-12