Answer
The solution is $x=\frac{3\pi }{2}$.
Work Step by Step
Consider the given trigonometric equation:
$\begin{align}
& {{\cos }^{2}}x+\sin x+1=0 \\
& 1-{{\sin }^{2}}x+\sin x+1=0 \\
& {{\sin }^{2}}x-\sin x-2=0 \\
& {{\sin }^{2}}x+\sin x-2\sin x-2=0
\end{align}$
It can be further simplified as:
$\begin{align}
& \sin x\left( \sin x+1 \right)-2\left( \sin x+1 \right)=0 \\
& \left( \sin x+1 \right)\left( \sin x-2 \right)=0
\end{align}$
Therefore,
$\sin x=2\,\,\text{or}\,\,-1$
As $-1\le \sin x\le 1$ hence $\sin x\ne 2$ Therefore,
$\sin x=-1$
That is
$\begin{align}
& \sin x=\sin \frac{\pi }{2} \\
& x=\frac{3\pi }{2}
\end{align}$
The solution of the equation in $\left[ 0,2\pi \right]$ is $\frac{3\pi }{2}$.