Example 12. Factorize:
$$
\left(3 x^{2}-2 x+1\right)\left(3 x^{2}-2 x-7\right)+12
$$
Let $y=3 x^{2}-2 x+1$, then
$$
\begin{array}{l}
\text { original expression }=y(y-8)+12 \\
=(y-2) \cdot(y-6) \\
=\left[\left(3 x^{2}-2 x+1\right)-2\right] \\
\cdot\left[\left(3 x^{2}-2 x+1\right)-6\right] \\
=(x-1)(3 x+1)(x+1)(3 x-5),
\end{array}
$$