Example 3 Solve the equation
$$
\sqrt{x}+\sqrt{y-1}+\sqrt{z-2}=\frac{1}{2}(x+y+z) .
$$
Solution: Completing the square for the original equation, we get
$$
\begin{array}{l}
(\sqrt{x}-1)^{2}+(\sqrt{y-1}-1)^{2} \\
+(\sqrt{z-2}-1)^{2}=0 .
\end{array}
$$

Thus, $\sqrt{x}-1=\sqrt{y-1}-1=\sqrt{z-2}-1$
$$
=0 \text {, }
$$

which means $x=1, y=2, z=3$.