If $\mathbf A$ and $\mathbf B$ are vectors then how can we express one of them in terms of the other and the cosine/sine of the angle between them?
I couldn't find a better picture, so let's assume $\mathbf C$ and $\mathbf B$ are perpendicular.
For example could we say that $\mathbf A=\cos\theta\mathbf B+\cos(\pi/2-\theta)\mathbf C$? If yes, why is it true? I don't know the method to derive the formula.
Does the above have to do with the projection of vector $\mathbf A$ onto vector $\mathbf B$?
Is it true for unit basis of vectors $(\mathbf e_1,\mathbf e_2,\mathbf e_3)$?


The answer is no, in general the coefficients are not $\sin \theta$ and $\cos \theta $.
It depends on the angle between $B$ and $C$
Geometrically you can decompose vector $A$ in tow vectors, where one is in the direction of $B$ and the other in the direction of $C$.
From the terminal point of $A$, draw lines parallel to B and $C$ to form a parallelogram with $A$ being the diagonal and $B$ and $C$ are in the direction of sides.
Algebraically if you have $B=(b_1, b_2)$ and $C=(c_1,c_2)$ such that they are not on the same line, then any vector $ A=(a_1, a_2)$ can be decomposed as $A= \alpha B + \beta C$ where $\alpha$ and $\beta$ are constants to be found by solving a system.