Example 1 Let $z \in \mathbf{C}$,
$$
\arg \left(z^{2}-4\right)=\frac{5 \pi}{6}, \arg \left(z^{2}+4\right)=\frac{\pi}{3} \text {. }
$$

Find $z$.
Let $z^{2}=a+b \mathrm{i}(a, b \in \mathbf{R})$.
From the problem, we have
$$
\tan \frac{5 \pi}{6}=\frac{b}{a-4}=-\frac{1}{\sqrt{3}}, \tan \frac{\pi}{3}=\frac{b}{a+4}=\sqrt{3} .
$$

Solving these, we get $a=-2, b=2 \sqrt{3}$.
$$
\begin{array}{l}
\text { Hence } z^{2}=-2+2 \sqrt{3} \mathrm{i}=4\left(\cos \frac{2 \pi}{3}+\mathrm{i} \sin \frac{2 \pi}{3}\right) \\
\Rightarrow z= \pm 2\left(\cos \frac{\pi}{3}+\mathrm{i} \sin \frac{\pi}{3}\right)= \pm(1+\sqrt{3} \mathrm{i}) .
\end{array}
$$