Consider $p^{2}-10p+24+6q-9q^{2}$ as a polynomial over variable $p$.
$$p^{2}-10p+24+6q-9q^{2}$$
Find one factor of the form $p^{k}+m$, where $p^{k}$ divides the monomial with the highest power $p^{2}$ and $m$ divides the constant factor $-9q^{2}+6q+24$. One such factor is $p+3q-6$. Factor the polynomial by dividing it by this factor.