<s>[INST] Find all $x\in \mathbb{Z}$ with $x \equiv 2 \mod 4$ , $x \equiv 8\mod9$ and $x \equiv 1\mod5$ 
Find all $x\in \mathbb{Z}$ with $x \equiv 2 \mod 4$ , $x \equiv 8\mod9$ and $x \equiv 1\mod5$

My attempt:
$\gcd\left(9,5,4\right) = 1 = 9r+5s+4\times0$
$9 = 1\times5+4$
$5 = 1\times4+1$
so $1 = 5-(9-5) = 2\times5 - 1\times9$
thus $r=-1$ and $s = 2$
so $x = 2\times5\times8 -1\times9\times1=80 - 9=71\mod 180$
But the problem is that $71\equiv8\mod9$ and $71\equiv1\mod5$, but $71 \ne 2 \mod 4$. What is wrong?
 [/INST] Hint $\ \overbrace{x = \color{#0a0}{-1\!+\!9}(a\!+\!5(b\!+\!4c))}^{\text{by iterated division}}\,$ so $\overbrace{\color{#90f}{\bmod 5}\Rightarrow a\equiv 3}^{\large\color{#90f}{x\ \equiv\ 1}};\ $ $\overbrace{\color{#c00}{\bmod 4}\Rightarrow b\equiv 0}^{\large\color{#c00}{x\ \equiv\ 2}},\,$ so $\ \bbox[5px,border:1px solid #c00]{x= 26\!+\!180c}$
Remark $ $ What went wrong in your method is you didn't correctly apply the CRT formula (or you incorrectly tried to generalize the formula for two congruences). Applying the linked formula yields
$\!\begin{align}  x\,&\equiv\, \color{#c00}{2\pmod{4}}\ \ \ \  {\rm and}\,  \ \ \ x\equiv \color{#0a0}{-1\pmod{9}}\ \ \ \ \ {\rm and}\,\ \ \ \ \  x\equiv \color{#90f}{1\pmod{5}}\\[.5em]
\iff x\ &\equiv\, \color{#c00}2(9\cdot 5)\overbrace{((9\cdot 5)^{-1}\!\color{#c00}{\bmod 4)}}^{\large\! 1/45\ \equiv\ \color{#c00}{1/1}\ } \color{#0a0}{-1} (4\cdot 5)\overbrace{((4\cdot 5)^{-1}\!\color{#0a0}{\bmod 9)}}^{\large 1/20\ \equiv\ 10/2\ \equiv\ \color{#0a0}{5/1}} + \color{#90f}1(4\cdot 9)\overbrace{((4\cdot 9)^{-1}\!\color{#90f}{\bmod 5)}}^{\large\! 1/36\ \equiv\ \color{#90f}{1/1}}\\[.5em]
&\equiv\, \color{#c00}2(9\cdot 5)\,(\color{#c00}{1/1}) \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \color{#0a0}{-1} (4\cdot 5)\,(\color{#0a0}{5/1})   \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \:\!  + \color{#90f}1(4\cdot 9)\,(\color{#90f}{1/1})\\[.5em]
&\equiv\ \color{#c00}{90}\  \ - \ \ \color{#0a0}{100}\ \ +\ \ \color{#90f}{36}\ \bbox[5px,border:1px solid #c00]{\equiv\, 26\pmod{\!180}}
\end{align}$
See this answer for an intuitive explanation of the genesis of the above CRT formula (which will help you to correctly remember it and efficiently apply it).
</s>