I'm missing the right substitute $\sqrt3\cos x=1-\sin x$ Please show me how to solve the following equation for $x$.
I've tried multiple substitutes but can't seem to find the right one.
$$\sqrt3\cos x=1-\sin x$$

You don't have to guess the right substitution. Every equation of the form
$$
a\cos x+b\sin x = c
$$
can be managed with the following procedure.
Divide both sides by $\sqrt{a^2+b^2}$, which is different from $0$ unless $a=b=0$, which would make it trivial.
Now we can observe that there is a unique $\varphi$ such that
$$
\frac{a}{\sqrt{a^2+b^2}}=\sin\varphi,\quad \frac{b}{\sqrt{a^2+b^2}}=\cos\varphi,
$$
for
$$
\biggl(\frac{a}{\sqrt{a^2+b^2}}\biggr)^2+
\biggl(\frac{b}{\sqrt{a^2+b^2}}\biggr)^2=1.
$$
Thus the equation becomes
$$
\sin\varphi\cos x+\cos\varphi\sin x=\frac{c}{\sqrt{a^2+b^2}}
$$
or
$$
\sin(x+\varphi)=\frac{c}{\sqrt{a^2+b^2}}
$$
which is an elementary equation for the sine.
In your case $a=\sqrt{3}$, $b=1$, so $a^2+b^2=4$ and
$$
\sin\varphi=\frac{a}{\sqrt{a^2+b^2}}=\frac{\sqrt{3}}{2},\quad
\cos\varphi=\frac{b}{\sqrt{a^2+b^2}}=\frac{1}{2}
$$
so $\varphi=\pi/3$. Since $c=1$, the equation becomes
$$
\sin\biggl(x+\frac{\pi}{3}\biggr)=\frac{1}{2}=\sin\frac{\pi}{6}
$$
that has the solutions
$$
x+\frac{\pi}{3}=\frac{\pi}{6}+2k\pi,\qquad
x+\frac{\pi}{3}=\pi-\frac{\pi}{6}+2k\pi
$$
or, in another form
$$
x=-\frac{\pi}{6}+2k\pi,\qquad x=\frac{\pi}{2}+2k\pi.
$$

An alternative method is to set $X=\cos x$, $Y=\sin x$ and to solve the system
\begin{cases}
aX+bY=c\\[1ex]
X^2+Y^2=1
\end{cases}
which in this case is
\begin{cases}
\sqrt{3}\,X+Y=1\\[1ex]
X^2+Y^2=1
\end{cases}
Solve with respect to $Y$ the linear equation: $Y=1-\sqrt{3}\,X$ and substitute:
$$
X^2+(1-\sqrt{3}\,X)^2=1
$$
that becomes
$$
4X^2-2\sqrt{3}\,X=0
$$
that factors as
$$
X=0\qquad\text{or}\qquad 2X-\sqrt{3}=0
$$
that become
$$
\begin{cases}
\cos x=0\\[2ex]
\sin x=1
\end{cases}
\qquad\text{or}\qquad
\begin{cases}
\cos x=\frac{\sqrt{3}}{2}\\[2ex]
\sin x=-\frac{1}{2}
\end{cases}
$$
that give the same solutions as before.
