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^{2}-x-6\right)$$
Consider $x^{2}-x-6$. Factor the expression by grouping. First, the expression needs to be rewritten as $x^{2}+ax+bx-6$. To find $a$ and $b$, set up a system to be solved.
$$a+b=-1$$ $$ab=1\left(-6\right)=-6$$
Since $ab$ is negative, $a$ and $b$ have the opposite signs. Since $a+b$ is negative, the negative number has greater absolute value than the positive. List all such integer pairs that give product $-6$.
$$1,-6$$ $$2,-3$$
Calculate the sum for each pair.
$$1-6=-5$$ $$2-3=-1$$
The solution is the pair that gives sum $-1$.
$$a=-3$$ $$b=2$$
Rewrite $x^{2}-x-6$ as $\left(x^{2}-3x\right)+\left(2x-6\right)$.
$$\left(x^{2}-3x\right)+\left(2x-6\right)$$
Factor out $x$ in the first and $2$ in the second group.
$$x\left(x-3\right)+2\left(x-3\right)$$
Factor out common term $x-3$ by using distributive property.