If we now that 4y equals to x, that means we can replace x with 4y.
Therefore we can write: 4y+2y = 12
We can summarize that to 6y = 12.
If we divide both sides with 6, you get y = 2
In order to solve for x, we can use the second equation and just replace y with value we just got (y=2).
We can write: x+2*2=12
Now you move 2*2 (which is 4) to the other side: x=12-4
Now you get: x = 8