Example 3 Let $x, y, z$ be real numbers, not all zero, find the maximum value of $\frac{x y+2 y z}{x^{2}+y^{2}+z^{2}}$.


$$
\begin{array}{l}
xy + 2yz = 2\left(\sqrt{\frac{a}{2}} x\right)\left(\sqrt{\frac{1}{2a}} y\right) + 2(\sqrt{b} y)\left(\sqrt{\frac{1}{b}} z\right) \leqslant \left(\frac{a}{2} x^2 + \frac{1}{2a} y^2\right) + \left(by^2 + \frac{1}{b} z^2\right) \\
= \frac{a}{2} x^2 + \left(\frac{1}{2a} + b\right) y^2 + \frac{1}{b} z^2, \text{ let } \frac{a}{2} = \frac{1}{2a} + b = \frac{1}{b}, \text{ solving gives } a = \sqrt{5}, b = \frac{2\sqrt{5}}{5},
\end{array}
$$

Therefore, $xy + 2yz \leqslant \frac{\sqrt{5}}{2}(x^2 + y^2 + z^2)$, with equality holding when $10x = 2\sqrt{5}y = 5z$. Hence, the maximum value of $\frac{xy + 2yz}{x^2 + y^2 + z^2}$ is $\frac{\sqrt{5}}{2}$.