This is an instance of a “linear equation in sine and cosine”. There are several methods for solving them.
First method.
Write $X=\cos x$, $Y=\sin x$ and consider the system
$$
\begin{cases}
1+Y=X\\
X^2+Y^2=1
\end{cases}
$$
Substitute in the second equation to get
$$
1+2Y+Y^2+Y^2=1
$$
which gives
$$
Y^2+Y=0
$$
so $Y=0$ or $Y=-1$. Thus we get the two solutions
$$
\begin{cases}
X=1\\
Y=0
\end{cases}
\qquad\text{or}\qquad
\begin{cases}
X=0\\
Y=-1
\end{cases}
$$
Solved with respect to $x\in[-\pi,\pi]$, they give $x=0$ or $x=-\pi/2$.
Second method
Rewrite the equation as
$$
\cos x-\sin x=1
$$
and try to rewrite this as $A(\cos x\cos\phi-\sin x\sin\phi)=1$, with $A>0$. Thus we need
$$
A\cos\phi=1,\qquad A\sin\phi=1
$$
so $A^2\cos^2\phi+A^2\sin^2\phi=2$, or $A^2=2$; thus $A=\sqrt{2}$ and
$$
\cos\phi=\frac{1}{\sqrt{2}},\quad\sin\phi=\frac{1}{\sqrt{2}}
$$
that is, $\phi=\pi/4$. Thus the equation becomes
$$
\sqrt{2}\cos\left(x+\frac{\pi}{4}\right)=1
$$
that means
$$
x+\frac{\pi}{4}=\frac{\pi}{4}+2k\pi
\qquad\text{or}
x+\frac{\pi}{4}=-\frac{\pi}{4}+2k\pi
$$
and we get again $x=0$ or $x=-\pi/2$.
Third method
Set $t=\tan(x/2)$ and recall that
$$
\cos x=\frac{1-t^2}{1+t^2},\qquad
\sin x=\frac{2t}{1+t^2}
$$
that transforms the equation into
$$
1+\frac{2t}{1+t^2}=\frac{1-t^2}{1+t^2}
$$
that becomes
$$
1+t^2+2t=1-t^2
$$
or
$$
t^2+t=0
$$
so $t=0$ or $t=-1$. The first solution corresponds to
$$
\frac{x}{2}=k\pi \to x=2k\pi
$$
and the second solution corresponds to
$$
\frac{x}{2}=-\frac{\pi}{4}+k\pi \to x=-\frac{\pi}{2}+2k\pi
$$
and, again, in the given interval we have $x=0$ or $x=-\pi/2$.
You seem to have misunderstood what $x\in[-\pi,\pi]$ means. It means that you have to find all solutions $x$ such that
$$
-\pi\le x\le \pi
$$