Geometric
Here is a geometric illustration:
Start with two circles around the origin $O$, one with radius $OA=a$, the other with radius $OB=b$. Choose $A$ so its angle is $\theta$ (marked in cyan). Then projecting that onto the $x$ axis will give $OC=a\cos\theta$. Construct a line perpendicular to $OA$ and intersect it with the other circle to obtain $B$. Make sure to choose the right point of intersection: $B$ should be $90°$ behind $A$ in terms of angle, since $\sin$ is $90°$ begind $\cos$. Projecting $B$ onto the $x$ axis gives $OS=b\sin\theta$. Now you could add these projections, but you could also add the original vectors $OA$ and $OB$ to obtain $OD$ and then project the result $D$ to get $OE=a\cos\theta+b\sin\theta$.
Now as you rotate $A$, $B$ and $D$ will rotate along with it. So you can see that as $D$ moves at the same speed but on a larger circle, its projection $E$ will follow a cosine function so you have $OE=d\cos(\theta+\theta_0)$. You can use the Pythagorean theorem to find that $d^2=a^2+b^2$. You can also see that angle $\theta_0$, marked in orange and negative in my case. It's the angle between ray $OA$ and $OD$, and is defined by $\tan\theta_0=-\frac ba$ unless I got a knot in my thoughts with the sign. As usual when using a tangens to compute an angle from a fraction, make sure you end up in the correct quadrant, perhaps use an atan2
function if available.
Complex numbers
Since others answers brought up complex numbers, here is what you get if you do all of this in complex numbers:
\begin{align*}
A &= ae^{i\theta}=a\cos\theta+ai\sin\theta \\
B &= -bie^{i\theta}=b\sin\theta-bi\cos\theta \\
C &= \operatorname{Re}A = a\cos\theta \\
S &= \operatorname{Re}B = b\sin\theta \\
D &= A+B = (a-bi)e^{i\theta} = (de^{i\theta_0})e^{i\theta}
= de^{i(\theta+\theta_0)}\\
E &= \operatorname{Re}D = a\cos\theta+b\sin\theta = d\cos(\theta+\theta_0)
\end{align*}
So the core aspect here is the conversion from the Cartesian coordinates $a-bi$ to the polar coordinates $de^{i\theta_0}$. Which again can be characterized by $d^2=a^2+b^2$ and $\tan\theta_0=-\frac ba$. To avoid confusion: $a,b,d,\theta_0$ are all real numbers here.
We use the sine and cosine to decompose a vector into its horizontal and vertical components because the definition of sine and cosine (geometric wise) allows us to do so.
Consider the diagram below. By definition of cosine we have:
$cos \theta= \frac{|v_x|}{|v|}$ and so $|v_x|=|v|cos \theta$.
Similarly, $|v_y|=|v|sin \theta$.
Note that the expression merely gives the magnitude of the horizontal and vertical components of the vector itself.
So to answer your last question, we don't add vectors like 5cos35 + 5sin35 = 5. Instead by the pythagoras theorem, $|v|^2=|v_x|^2 + |v_y|^2$ which you can verify to be true by virtue of the identity $sin^2\theta+cos^2\theta=1$.
It is not by magic and sadly, the energy crisis is still ongoing and cannot be solved that easily.
Best Answer
You're being quite vague in a way that large numbers of students are. They see something like $$ (3-3b^2)\sin(bx)+3a\cos(2x)=6\cos(2x) \tag 1 $$ and think that this specifies an problem to be solved. But the words you wrote after that make it clear that whoever posed this said more than what you've told us.
A set of exercises in a textbook may say "Solve the following equations for $x$." It it had said that, that would be a very different problem from what you write about in your paragraph beginning with "The method employed". There is no reason why the coefficient of the sine term should not be $0$ if it says "Solve this equation for $x$."
But if it said that $(1)$ is an identity true of all values of $x$, and asks you to find the coefficients, then, because of the word all, we can conclude that the coefficient of the sine term is $0$.
If $x=0$ then the sine term vanishes and the cosine terms are equal to $1$, and we get $3a=6$ so $a=2$. Then if $x$ has some value that makes the sine nonzero, we get $$ (3-3b^2)\cdot(\text{some number other than 0}) + 6\cos(2x) = 6\cos(2x). $$ Subtracting $6\cos(2x)$ from both sides, we get $$ (3-3b^2)\cdot(\text{some number other than 0}) = 0, $$ and from that we can conclude that the coefficient is $0$.