Example 8 Given real numbers $x, y, z$ satisfy
$$
\begin{array}{l}
x+y+z=5, \\
x y+y z+z x=3 .
\end{array}
$$

Then the maximum value of $z$ is
Given $x+y+z=5$, we have
$$
y=5-x-z \text {. }
$$

Substituting into $x y+y z+z x=3$ yields a quadratic equation in $x$:
$$
x^{2}+(z-5) x+z^{2}-5 z+3=0 \text {. }
$$

Since $x$ and $z$ are real numbers, we have
$$
\begin{array}{l}
\Delta=(z-5)^{2}-4\left(z^{2}-5 z+3\right) \\
=-3 z^{2}+10 z+13 \geqslant 0 .
\end{array}
$$

Solving this, we get $-1 \leqslant z \leqslant \frac{13}{3}$.
Therefore, the maximum value of $z$ is $\frac{13}{3}$.