While trying to solve the equation $\sin\left(x\right)=\cos\left(2x\right)$, a user on this forum suggested that I turn the equation into a quadratic form by converting $\cos(2x)$ using the identity $\cos\left(2x\right)=1-2\sin^2\left(x\right)$.
What is the logic behind this identity and how can I derive it?

This identity follows from the more general
$$\cos (x+y)=\cos x \cos y - \sin x \sin y$$
by $y=x$, that is
$$\cos (2x)=\cos (x+x)=\cos x \cos x - \sin x \sin x=\cos^2 x-\sin^2 x=1-2\sin^2 x$$
using that $\cos^2 x=1-\sin^2 x$.
Refer also to the related