Calculate the Fourier coefficients $a_1, a_2, a_3, \ldots$ for the function $f(x)$, $x\in (-\pi, \pi)$ as for the orthogonal set of functions $S=\{\sin (x), \sin (2x), \sin(3x), \ldots \}$.
Does this mean that we have to calculate the integral on $x\in (-\pi, \pi)$ of $f(x)$ multiplied each with the functions of $S$ ?
I mean $$a_i=\int_{-\pi}^{\pi}f(x)\cdot \sin (ix)\, dx$$ Or what does this mean?
Since the set of basis functions are orthogonal with respect to the usual inner product, we can just compute the projections onto each of them to compute their coefficients.
Furthermore, you can see that the set of basis functions there are all unit vectors. So the projection coefficients simply come from the inner product. Which is exactly the expression you wrote down.
So that's exactly what you do. You've got it right.