This problem is one that can be confusing if not tackled orderly. Let us have an example of a system of 2 equation:
3x + 5y = 13
4x + 7y = 18
First we must choose one of the two and then express one of our variables with respect to the other. Let's take the first one and express y with respect to x:
3x + 5y = 13
5y = 13 - 3x
y = 13/5 - 3x/5
Already it doesn't look very nice, but do not panic! the next step is to use this formula for the next equation. By substituting y in the second equation with this function of x we will have a single equation with only x as an unknown:
4x + 7y = 18
4x + 7*(13/5 - 3x/5) = 18
Now we group the x factors toghether:
4x + 713/5 - 73 x/5 =18
(4 - 7*3/5)x + 713/5 =18
We put the constants on the right hand side and divide the whole equation by the x factor.
(4 - 21/5)x = 18 - 713/5
x = (18 - 91/5) / (4 -21/5)
Now it all comes down to a simple calculation for the numerator and denominator.
numerator = (18*5-91)/5 = -1/5
denominator = (4*5-21)/5 = -1/5
In this case they are equal, so we find x
x = 1
Now we substiture this result in the first equation and we can find the last unknown, y
3x + 5y = 13
3*1 +5y = 13
5y = 13-3
5y = 10
y = 2
The answers are x=1 and y=2. This is the simplest way to solve the 2 equation system and it work for any system. There are some methods that can solve system of more than 2 equations, but that is a topic for another time.