I approached the problem by projecting $f(x)$ onto each of the other functions (since they are an orthonormal basis) using the formula $$\langle f(x),\sin2x\rangle \sin2x + \langle f(x),\cos2x\rangle \cos2x.$$
Before I go through the computations, I wanted to make sure this is the correct approach. Thanks!
If you're working with the Fourier series (which is likely, because the two basis you give are orthogonal Fourier bases), your formula is how the projection should work.
Observation: If you're not required to show the process, just notice that $$ \sin^2x = 1-\cos^2x = 1-\frac{1+\cos2x}{2} = 1-\frac{1+\cos2x}{2} = \frac{1}{2} - \frac{1}{2}\cos 2x. $$ The extra constant $\displaystyle\frac{1}{2}$ is for the basis of $1$, which is orthogonal to both $\sin 2x$ and $\cos 2x$.