Example 4 Let $n$ be a positive integer. Find the following three sums:
$$
\begin{array}{l}
S_{n}=\mathrm{C}_{n}^{0}+\mathrm{C}_{n}^{3}+\cdots+\mathrm{C}_{n}^{3 k}+\cdots, \\
T_{n}=\mathrm{C}_{n}^{1}+\mathrm{C}_{n}^{4}+\cdots+\mathrm{C}_{n}^{3 k+1}+\cdots, \\
H_{n}=\mathrm{C}_{n}^{2}+\mathrm{C}_{n}^{5}+\cdots+\mathrm{C}_{n}^{3 k+2}+\cdots .
\end{array}
$$

Here it is specified that when $m>n$, $\mathrm{C}_{n}^{m}=0$.
Solution: Clearly, $S_{n}+T_{n}+H_{n}=2^{n}$.
Let $\omega=\cos \frac{2 \pi}{3}+\mathrm{i} \sin \frac{2 \pi}{3}$. Then
$$
\omega^{3}=1,1+\omega+\omega^{2}=0 \text {. }
$$

Notice,
$$
\begin{array}{l}
(1+1)^{n}=\mathrm{C}_{n}^{0}+\mathrm{C}_{n}^{1}+\cdots+\mathrm{C}_{n}^{n} \\
(1+\omega)^{n}=\mathrm{C}_{n}^{0}+\omega \mathrm{C}_{n}^{1}+\cdots+\omega^{n} \mathrm{C}_{n}^{n} \\
\left(1+\omega^{2}\right)^{n}=\mathrm{C}_{n}^{0}+\omega^{2} \mathrm{C}_{n}^{1}+\cdots+\omega^{2 n} \mathrm{C}_{n}^{n} .
\end{array}
$$

Adding the three equations and using the conclusion (1), we get
$$
2^{n}+(1+\omega)^{n}+\left(1+\omega^{2}\right)^{n}=3 S_{n} \text {. }
$$

Since $1+\omega=-\omega^{2}, 1+\omega^{2}=-\omega$, equation (5) becomes
$$
\begin{array}{l} 
3 S_{n}=2^{n}+(-1)^{n}\left(\omega^{2 n}+\omega^{n}\right) \\
= 2^{n}+(-1)^{n}\left(\cos \frac{4 n \pi}{3}+\mathrm{i} \sin \frac{4 n \pi}{3}+\right. \\
\left.\cos \frac{2 n \pi}{3}+\mathrm{i} \sin \frac{2 n \pi}{3}\right) \\
= 2^{n}+(-1)^{n}\left(2 \cos n \pi \cdot \cos \frac{n \pi}{3}+\right. \\
\left.\mathrm{i} \cdot 2 \sin n \pi \cdot \cos \frac{n \pi}{3}\right) \\
= 2^{n}+2(-1)^{n} \cos n \pi \cdot \cos \frac{n \pi}{3} \\
= 2^{n}+2 \cos \frac{n \pi}{3} .
\end{array}
$$

Thus, $S_{n}=\frac{1}{3}\left(2^{n}+2 \cos \frac{n \pi}{3}\right)$.
(2) $+\omega^{2} \times$ (3) $+\omega \times$ (4), similarly we get
$$
T_{n}=\frac{1}{3}\left(2^{n}+2 \cos \frac{(n-2) \pi}{3}\right) \text {; }
$$
(2) $+\omega \times(3)+\omega^{2} \times$ (4) we get
$$
H_{n}=\frac{1}{3}\left(2^{n}-2 \cos \frac{(n-1) \pi}{3}\right) .
$$