The general rule is to multiply one equation by whatever it needs so that it either has the same number of x as the other equation, or the same number of y.
Once you have done that you can subtract the other original equation from the one you just calculated, to get an equation with just a single unknown variable, which is trivial to solve.
Having worked out one variable you just substitue for it in one of the equations and solving for the other unknown becomes trivial.