Example 1 Suppose the equation $3 x^{2}-6(m-1) x+m^{2}+1$ $=0$ has 2 roots whose magnitudes sum to 2. Find the value of the real number $m$.
(1) When $\Delta=36(m-1)^{2}-12\left(m^{2}+1\right) \geqslant 0$, let the equation have 2 real roots $x_{1} 、 x_{2}$.

By Vieta's formulas, we have $x_{1} x_{2}=\frac{m^{2}+1}{3}>0$, so $x_{1}$ and $x_{2}$ have the same sign. Therefore,
$$
\left|x_{1}\right|+\left|x_{2}\right|=\left|x_{1}+x_{2}\right| .
$$

Again by Vieta's formulas,
$$
\left|x_{1}\right|+\left|x_{2}\right|=2|m-1|=2 \text {, }
$$

then $m=0$ or $m=2$.
Only $m=0$ satisfies $\Delta \geqslant 0$.
(2) When $\Delta=36(m-1)^{2}-12\left(m^{2}+1\right)<0$, the equation has 2 complex roots $x_{1} 、 x_{2}$, and $x_{1} 、 x_{2}$ are conjugate complex numbers, then
$$
\left|x_{1}\right|^{2}=\left|x_{2}\right|^{2}=x_{1} x_{2}=\frac{m^{2}+1}{3}=1 \text {. }
$$

Thus, $m= \pm \sqrt{2}$.
Only $m=\sqrt{2}$ satisfies $\Delta<0$.
From (1) and (2), the required $m$ is
$m=0$ or $m=\sqrt{2}$.