Factor the expression by grouping. First, the expression needs to be rewritten as $p^{2}+ap+bp-12$. To find $a$ and $b$, set up a system to be solved.
$$a+b=-1$$ $$ab=1\left(-12\right)=-12$$
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 $-12$.
$$1,-12$$ $$2,-6$$ $$3,-4$$
Calculate the sum for each pair.
$$1-12=-11$$ $$2-6=-4$$ $$3-4=-1$$
The solution is the pair that gives sum $-1$.
$$a=-4$$ $$b=3$$
Rewrite $p^{2}-p-12$ as $\left(p^{2}-4p\right)+\left(3p-12\right)$.
$$\left(p^{2}-4p\right)+\left(3p-12\right)$$
Factor out $p$ in the first and $3$ in the second group.
$$p\left(p-4\right)+3\left(p-4\right)$$
Factor out common term $p-4$ by using distributive property.