<s>[INST] Solving a system of modular equations I am trying to solve this system of equations：

$24x ≡ 12 \hspace{5pt} (\mathrm{mod} \hspace{2pt} 63)$
$x ≡ 2\hspace{5pt} (\mathrm{mod} \hspace{2pt} 27)$

So I know that the second equation is equivalent to $x=27y+2$, but when I plug it into $24x ≡ 12\hspace{5pt} (\mathrm{mod} \hspace{2pt} 63)$, I got $2y ≡ 3\hspace{5pt} (\mathrm{mod} \hspace{2pt} 7)$ and I don’t know what to do next... Did I do something wrong?
 [/INST] Do you know about modular inverse ?
Here you have $\quad 2y\equiv 3 \pmod 7$
Notice that when we multiply by $4$ we get $\quad 8y\equiv 12\pmod 7$ 
And since $8\equiv 1\pmod 7$ and $12\equiv 5\pmod 7$ we get in the end $\quad y\equiv 5\pmod 7$
We say that $4$ is the inverse of $2$, since $2\times 4\equiv 1\pmod  7$
Now replace $y=7k+5$ in $x=27y+2=137+189k$

Here is now a way to get to apply the Chinese remainder theorem.
$\begin{cases} 24x\equiv 12\pmod{63}\\x\equiv 2\pmod{27}\end{cases}$
The first thing to do is to use modular inverse to have equations of the form $x\equiv a_i\pmod {m_i}$
Unfortunately here $\gcd(24,63)=3$ thus $24$ does not have an inverse modulo $63$.
But since $12$ is also a multiple of $3$ we can divide the whole equation by the gcd.
We now have $\begin{cases} 8x\equiv 4\pmod{21}\\x\equiv 2\pmod{27}\end{cases}$
Since $8^{-1}\equiv 8\pmod{21}$ we multiply by $8$ in first equation.
$\begin{cases} x\equiv 11\pmod{21}\\x\equiv 2\pmod{27}\end{cases}$
We still can't apply CRT because the $m_i$ have common factors $21=3\times 7$ and $27=3^3$.
So we will split the first equation into two:
$\begin{cases} x\equiv 2\pmod{3}\\x\equiv 4\pmod{7}\\x\equiv 2\pmod{27}\end{cases}$
Now we have to deal with first and third equations, but notice that every solution of the third one is automatically solution of the first one.
So we can reduce the system to:
$\begin{cases} x\equiv 4\pmod{7}\\x\equiv 2\pmod{27}\end{cases}$
It has a unique solution modulo $7\times 27=189$ and applying the CRT gives $x\equiv 137\pmod{189}$
</s>