If we have two equations that look like this:
a1 * x + b1 * y = c1
and
a2 * x + b2 * y = c2
where x,y are variables and a1,a2,b1,b2 are coeficients.
then we solve it using the following method:
We choose either x or y and we try to reduce their coeficients so that either a1=a2 or b1=b2. If we make one of these possible, then we can reduce one of the variables and we are left with the other. Let's assume that we have a1=a2=a. Then:
a * x + b1 * y = c1
a * x + b2 * y = c2
We can reduce the two equations and we are left with:
(b1-b2) * y = c1 - c2
From here we can find y as we know the values of b1,b2,c1 and c2. After that, we replace y in one of the equations and we deduce x.
If a1 was different from a2, then we would've had to multiply the equations so that we can make those two equal.
Thus, we have solved a two-equation, two-unknown values system.