Answer
The solution in the interval $\left[ 0,2\pi \right]$ is $\frac{3\pi }{2}$
Work Step by Step
$\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=0
\end{align}$
Now,
$\begin{align}
& {{\left( \sin x \right)}^{2}}-\sin x-2=0 \\
& {{\left( \sin x \right)}^{2}}-2\sin x+\sin x-2=0 \\
& \sin x\left( \sin x-2 \right)+1\left( \sin x-2 \right)=0 \\
& \left( \sin x+1 \right)\left( \sin x-2 \right)=0
\end{align}$
From here,
$\sin x=-1$ or $\sin x=2$
$\sin x=2$ is not possible as the range of the sin function is from $\left[ -1,1 \right]$
Therefore,
$\begin{align}
& \sin x=-1 \\
& x=\frac{3\pi }{2} \\
\end{align}$