How do you solve linear congruences with two variables.

$$x+2y\equiv3\pmod9$$ $$6x+12y\equiv18\pmod9$$ $$6x+3y\equiv0\pmod9$$

Adding this to the other equation

$$9x+4y\equiv2\pmod9$$ $$4y\equiv2\pmod9$$ $$28y\equiv14\pmod9$$ $$y\equiv5\pmod9$$

Plugging back in for $y$ in the first equation $$x+2(5)\equiv3\pmod9$$ $$x+1\equiv3\pmod9$$ $$x\equiv2\pmod9$$


Write the system in matrix form: $$\left[\matrix{1 & 2 \cr 3 & 1 \cr}\right] \left[\matrix{x \cr y \cr}\right] = \left[\matrix{3 \cr 2 \cr}\right].$$

Since $\det \left[\matrix{1 & 2 \cr 3 & 1 \cr}\right] = -5 = 4 \ne 0$, the matrix is invertible mod $9$; its inverse (using the standard formula for the inverse of a $2 \times 2$ matrix is $$\left[\matrix{7 & 4 \cr 6 & 7 \cr}\right].$$

So $$\left[\matrix{x \cr y \cr}\right] = \left[\matrix{7 & 4 \cr 6 & 7 \cr}\right] \left[\matrix{3 \cr 2 \cr}\right] = \left[\matrix{2 \cr 5 \cr}\right].$$


The CRT is used solve systems of congruences of the form $\rm x\equiv a_i\bmod m_{\,i}$ for distinct moduli $\rm m_{\,i}$; in our situation, there is only one variable and only one moduli, but different linear congruences, so this is not the sort of problem where CRT applies. Rather, this is linear algebra.

Instead, you are working with a $2\times2$ linear system over a given modulus, $9$. Here, the first two elementary methods of solving linear systems apply: substitution and elimination. The difference, however, is that we cannot generally divide by anything sharing divisors with $9$, i.e. multiples of $3$. And if, in your quest to eliminate variables, you multiply by things not coprime to the modulus, you can end up adding extraneous non-solutions, so it can be dangerous if you're not careful.

Let's use substitution. The congruences here are

$$\begin{cases}\rm x+2y\equiv 3 \mod 9, \\ \rm 3x+y\equiv2 \mod 9.\end{cases}$$

The first congruence gives $\rm x\equiv 3-2y$; plug this into the second to obtain

$$\rm 3x+y\equiv 3(3-2y)+y\equiv -5y\equiv2\mod 9.$$

Now $-5$ is coprime to $9$ so we can divide by it, i.e. multiply by its reciprocal mod $9$. In this case the reciprocal is $-5^{-1}\equiv-2\equiv7\bmod 9$, so the solution for $\rm y$ is $\rm y\equiv7\cdot2\equiv5\bmod 9$. To find $\rm x$, plug in $\rm y\equiv5$ into the congruences, obtaining $\rm x+10\equiv3$ and $\rm 3x+5\equiv2$. The first gives $\rm x\equiv2$, so that we have the unique solution $\rm (x,y)\equiv(2,5)$. However the second gives $\rm 3x\equiv-3\bmod9$, which, after dividing, gives $\rm x\equiv-1\equiv2\bmod3$ so that $\rm x\in\{2,5,7\}\bmod 9$; this doesn't change the fact that $(2,5)$ is the unique solution to the system, but it does illustrate that dividing by things that are not coprime to the modulus can introduce unwanted, fake solutions.

Note that matrix multiplication makes sense taken modulo an integer. The potential issues arise when we want inverses. If a matrix inverse $\rm A^{-1}$ exists of an integer-entry matrix $\rm A$, and every denominator appearing in the resulting rationals is coprime to the modulus (equivalently: $\rm\det A$ is coprime to the modulus), then $\rm A^{-1}$ can be reduced under the modulus (rationals like $\rm a/b$ become as $\rm ab^{-1}\bmod m$; this sort of thing is valid because there is a "ring homomorphism ${\bf Z}_{(p)}\to{\bf Z}/p{\bf Z}$"), and the result will be an inverse of $\rm A$ with respect to the modulus, i.e. $\rm A\, A^{-1}\equiv I\bmod m$. This is why bikenaga's answer works, using matrices, and it makes things quite easier when applicable.