Why does Fourier Series have $\sin$ and $\cos$ Components
Note that the value of the series

$$\sum_{n=1}^{\infty}B_n\sin(nx)\tag{1}$$

for $x=0$ is always zero, regardless of the coefficients $B_n$ (assuming convergence). Furthermore, since the functions $\sin(nx)$ are odd, (1) can only represent odd functions. So you cannot represent general functions with the series (1). This is why you also need the cosine terms. As an alternative, you could as well use a representation with phases in the argument of the sine:

$$f(x)=A_0+\sum_{n=1}^{\infty}C_n\sin(nx+\phi_n)\tag{2}$$

In this case you don't need any cosine terms because of the phases $\phi_n$. The representation in (2) is equivalent to the series in your question using sine and cosine terms. You can see this by using the identity $\sin(\alpha+\beta)=\cos\alpha\sin\beta+\sin\alpha\cos\beta$:

$$\sum_{n=1}^{\infty}C_n\sin(nx+\phi_n)=\sum_{n=1}^{\infty}\left[C_n\sin\phi_n\cos(nx)+C_n\cos\phi_n\sin(nx)\right]$$

So the coefficients $A_n$ and $B_n$ in your question are

$$A_n=C_n\sin\phi_n\\
B_n=C_n\cos\phi_n$$

And the other way around you have

$$C_n=\sqrt{A_n^2+B_n^2}\\
\phi_n=\arctan\left(\frac{A_n}{B_n}\right)\quad(\pm\pi)$$