Example 1 Find the maximum value of the function $y=\frac{\sin x}{2+\cos x}(0<x<\pi)$.
Solution: From the analysis, we have $4 y^{2}=[1 \cdot \sin x+(-y) \cdot \cos x]^{2}$ $\leqslant\left[1^{2}+(-y)^{2}\right]\left(\sin ^{2} x+\cos ^{2} x\right)=1+y^{2}$, which means $y^{2} \leqslant$ $\frac{1}{3}$.

Also, $y>0, \therefore 0<y \leqslant \frac{\sqrt{3}}{3}$. The equality holds when $\tan x=-\sqrt{3}$, i.e., $x=\frac{2 \pi}{3}$. Therefore, the maximum value of the function is $\frac{\sqrt{3}}{3}$.