Example 4 In the sequence $\left\{a_{n}\right\}$, $a_{1}=4$, and $a_{n+1}=\frac{3 a_{n}+2}{a_{n}+4}\left(n \in \mathbf{N}^{*}\right)$, find the general term formula $a_{n}$.
Solution: The characteristic equation is $x=\frac{3 x+2}{x+4}$. Solving it yields $x_{1}=1, x_{2}=-2$.
First, use $x_{1}=1$ as the constant $x$ for the sequence substitution: Let $b_{n}=a_{n}-1\left(n \in \mathbf{N}^{*}\right)$, then $a_{n}=b_{n}+1\left(n \in \mathbf{N}^{*}\right)$. Substituting it into the original recurrence relation gives $b_{n+1}+1=\frac{3\left(b_{n}+1\right)+2}{\left(b_{n}+1\right)+4}$, thus $b_{n+1}=\frac{2 b_{n}}{b_{n}+5}\left(n \in \mathbf{N}^{*}\right)$.
Since $b_{1}=a_{1}-1=3 \neq 0$, we have $b_{k} \neq 0\left(k \in \mathbf{N}^{*}\right)$.
Therefore, the recurrence relation can also be written as $\frac{1}{b_{n+1}}=\frac{5}{2} \cdot \frac{1}{b_{n}}+\frac{1}{2}\left(n \in \mathbf{N}^{*}\right)$.
So $\frac{1}{b_{n}}+\frac{1}{3}=\left(\frac{1}{b_{1}}+\frac{1}{3}\right)\left(\frac{5}{2}\right)^{n-1}=\left(\frac{1}{3}+\frac{1}{3}\right)\left(\frac{5}{2}\right)^{n-1}=\frac{2}{3} \cdot\left(\frac{5}{2}\right)^{n-1}$.
Hence $b_{n}=\frac{3 \cdot 2^{n-1}}{2 \cdot 5^{n-1}-2^{n-1}}=\frac{3 \cdot 2^{n-2}}{5^{n-1}-2^{n-2}}\left(n \in \mathbf{N}^{*}\right)$.
Since $a_{n}=b_{n}+1$, we have $a_{n}=\frac{2^{n-1}+5^{n-1}}{5^{n-1}-2^{n-1}}\left(n \in \mathbf{N}^{*}\right)$.
Note: Similarly, we can use the second root $x_{2}=-2$ of the characteristic equation for substitution:
Let $b_{n}=a_{n}+2$, then $a_{n}=b_{n}-2\left(n \in \mathbf{N}^{*}\right)$, substituting it into the original recurrence relation gives $b_{n+1}=\frac{5 b_{n}}{b_{n}+2}\left(n \in \mathbf{N}^{*}\right)$.
Here $b_{1}=a_{1}+2=6 \neq 0$, so $b_{k} \neq 0\left(k \in \mathbf{N}^{*}\right)$.
Thus, the recurrence relation can be written as $\frac{1}{b_{n+1}}=\frac{2}{5} \cdot \frac{1}{b_{n}}+\frac{1}{5}\left(n \in \mathbf{N}^{*}\right)$. Hence $\frac{1}{b_{n+1}}-\frac{1}{3}=\frac{2}{5}\left(\frac{1}{b_{n}}-\frac{1}{3}\right)\left(n \in \mathbf{N}^{*}\right)$.
So $\frac{1}{b_{n}}-\frac{1}{3}=\left(\frac{1}{b_{1}}-\frac{1}{3}\right) \cdot\left(\frac{2}{5}\right)^{n-1}=-\frac{1}{6}\left(\frac{2}{5}\right)^{n-1}$, thus $b_{n}=\frac{3 \cdot 5^{n-1}}{5^{n-1}-2^{n-2}}\left(n \in \mathbf{N}^{*}\right)$.
Since $a_{n}=b_{n}-2$, we have $a_{n}=\frac{3 \cdot 5^{n-1}}{5^{n-1}-2^{n-2}}-2=\frac{5^{n-1}+2^{n-1}}{5^{n-1}-2^{n-1}}\left(n \in \mathbf{N}^{*}\right)$.
Analysis: It can be seen that when the characteristic equation has two different roots, arbitrarily selecting one root for the sequence substitution $b_{n}=a_{n}-x_{i}(i=1$ or 2$)$, can transform the original recurrence relation into a recurrence relation $b_{n+1}=\frac{\alpha_{1}^{\prime} b_{n}}{\alpha_{2} b_{n}+\beta_{2}}$, and then find $b_{n}$ to determine $a_{n}$. Moreover, the general term formula obtained is the same. When the two roots of the characteristic equation are imaginary, the method of finding the general term formula is also correct.