I wanted to solve the following:
$x\equiv2 (\text{mod 3})$
$x\equiv5 (\text{mod 6})$
$x\equiv7 (\text{mod 8})$
I rewrote the first congruence as $x=2+3a$ and in (mod 6), this can be written $2+3a\equiv5(\text{mod 6})$, which has solution $a\equiv1 (\text{mod 6})$, which implies $a=1+6k$.
Substituting this in for our first expression for $x$ gives $x=5+18k$ which can be written as $x\equiv5 (\text{mod 18})$.
I repeated this process with new expression for $x$ and the expression mod 8 and found that $x\equiv23 (\text{mod 144})$, however apparently the answer is $x\equiv23 (\text{mod 24})$. I am confused about how they simplified the mod?
As lulu explained in a comment, when moduli are not relatively prime, simultaneous congruences could be redundant or contradictory. In your case, $\color{blue}3$ and $\color{blue}8$ are relatively prime, but $6$ is not, and as long as $x\equiv2\pmod3$ and $x\equiv7\pmod8$, then $x\equiv-1\pmod3$ and $x\equiv-1\pmod2$, so $x\equiv-1\pmod6$, and $x\equiv5\pmod6$ is redundant. That is how the answer became modulo $\color{blue}3\times\color{blue}8=24$.