Step 1 :
Factor out common factor $ \color{blue}{ 3r } $:
$$ 21p^2r-165pqr-24q^2r = 3r ( 7p^2-55pq-8q^2 ) $$Step 2 :
$ 7p^2-55pq-8q^2 $ can be written as
$$ 7p^2-55pq-8q^2 = \left( p-8q \right) \left( 7p+q \right)$$The explanation for this step cannot be generated.