By Rational Root Theorem, all rational roots of a polynomial are in the form $\frac{p}{q}$, where $p$ divides the constant term $24$ and $q$ divides the leading coefficient $1$. One such root is $4$. Factor the polynomial by dividing it by $x-4$.
$$\left(x-4\right)\left(x^{3}+4x^{2}+x-6\right)$$
Consider $x^{3}+4x^{2}+x-6$. By Rational Root Theorem, all rational roots of a polynomial are in the form $\frac{p}{q}$, where $p$ divides the constant term $-6$ and $q$ divides the leading coefficient $1$. One such root is $-3$. Factor the polynomial by dividing it by $x+3$.
$$\left(x+3\right)\left(x^{2}+x-2\right)$$
Consider $x^{2}+x-2$. Factor the expression by grouping. First, the expression needs to be rewritten as $x^{2}+ax+bx-2$. To find $a$ and $b$, set up a system to be solved.
$$a+b=1$$ $$ab=1\left(-2\right)=-2$$
Since $ab$ is negative, $a$ and $b$ have the opposite signs. Since $a+b$ is positive, the positive number has greater absolute value than the negative. The only such pair is the system solution.
$$a=-1$$ $$b=2$$
Rewrite $x^{2}+x-2$ as $\left(x^{2}-x\right)+\left(2x-2\right)$.
$$\left(x^{2}-x\right)+\left(2x-2\right)$$
Factor out $x$ in the first and $2$ in the second group.
$$x\left(x-1\right)+2\left(x-1\right)$$
Factor out common term $x-1$ by using distributive property.