Step 1 :
After factoring out $ 3 $ we have:
$$ 3q^{2}-12 = 3 ( q^{2}-4 ) $$Step 2 :
Rewrite $ q^{2}-4 $ as:
$$ q^{2}-4 = (q)^2 - (2)^2 $$Now we can apply the difference of squares formula.
$$ I^2 - II^2 = (I - II)(I + II) $$After putting $ I = q $ and $ II = 2 $ , we have:
$$ q^{2}-4 = (q)^2 - (2)^2 = ( q-2 ) ( q+2 ) $$