$f(x) = |\sin(x)| \quad \Rightarrow\quad f(x) = \left\{
\begin{array}{l l}
-\sin(x) & \quad \forall x \in [- \pi, 0\space]\\
\sin(x) & \quad \forall x \in [\space 0,\pi\space ]\\
\end{array} \right.$
The Fourier coefficients associated are
$$a_n= \frac{1}{\pi}\int_{-\pi}^\pi f(x) \cos(nx)\, dx = \frac{1}{\pi} \left[\int_{-\pi}^0 -\sin (x) \cos(nx)\, dx + \int_{0}^\pi \sin(x) \cos(nx)\, dx\right], \quad n \ge 0$$
$$b_n= \frac{1}{\pi}\int_{-\pi}^\pi f(x) \sin(nx)\, dx = \frac{1}{\pi} \left[\int_{-\pi}^0 -\sin (x) \sin(nx)\, dx + \int_{0}^\pi \sin(x) \sin(nx)\, dx\right], \quad n \ge 1$$
All functions are integrable so we can go on and compute the expressions for $a_n$ and $b_n$.
$$a_n = \cfrac{2 (\cos(\pi n)+1)}{\pi(1-n^2)}$$
$$b_n = 0$$
The $b_n = 0$ can be deemed obvious since the function $f(x) = |\sin(x)|$ is an even function. and $a_n$ could have been calculated as $\displaystyle a_n= \frac{2}{\pi}\int_{0}^\pi f(x) \cos(nx)\, dx $ only because the function is even.
The Fourier Series is $$\cfrac {a_0}{2} + \sum^{\infty}_{n=1}\left [ a_n \cos(nx) + b_n \sin (nx) \right ]$$
$$= \cfrac {2}{\pi}\left ( 1 + \sum^{\infty}_{n=1} \cfrac{(\cos(\pi n)+1)}{(1-n^2)}\cos(nx)\right )$$
$$= \cfrac {2}{\pi}\left ( 1 + \sum^{\infty}_{n=1} \cfrac{((-1)^n+1)}{(1-n^2)}\cos(nx)\right )$$
$$= \cfrac {2}{\pi}\left ( 1 + \sum^{\infty}_{n=1} \cfrac{2}{(1-4n^2)}\cos(2nx)\right )$$
Since for an odd $n$, $((-1)^n+1) = 0$ and for an even $n$, $((-1)^n+1) = 2$
At this point we can't just assume the function is equal to its Fourier Series, it has to satisfy certain conditions. See Convergence of Fourier series.
Without wasting time, (you still have to prove that it satisfies those conditions) we assume the Fourier Series converges to our function i.e
$$f(x) = |\sin(x)| = \cfrac {2}{\pi}\left ( 1 + \sum^{\infty}_{n=1} \cfrac{2}{(1-4n^2)}\cos(2nx)\right )$$
Note that $x=0$ gives $\cos(2nx) = 1$ then
$$f(0) = |\sin(0)| = \cfrac {2}{\pi}\left ( 1 + 2\sum^{\infty}_{n=1} \cfrac{1}{(1-4n^2)}\right ) =0$$ which implies that
$$\sum^{\infty}_{n=1} \cfrac{1}{(1-4n^2)} = \cfrac {-1}{2}$$ and $$\boxed {\displaystyle\sum^{\infty}_{n=1} \cfrac{1}{(4n^2 -1)}= -\sum^{\infty}_{n=1} \cfrac{1}{(1-4n^2)} = \cfrac {1}{2}}$$
Observe again that when $x = \cfrac \pi 2$, $\cos (2nx) = cos(n \pi) = (-1)^n$, thus
$$f \left (\cfrac \pi 2 \right) = \left |\sin \left (\cfrac \pi 2\right )\right | = \cfrac {2}{\pi}\left ( 1 + 2\sum^{\infty}_{n=1} \cfrac{(-1)^n}{(1-4n^2)}\right ) =1$$ which implies that
$$\sum^{\infty}_{n=1} \cfrac{(-1)^n}{(1-4n^2)} = \cfrac {1}{4}(\pi -2)$$ and $$\boxed {\displaystyle\sum^{\infty}_{n=1} \cfrac{(-1)^n}{(4n^2 -1)}= -\sum^{\infty}_{n=1} \cfrac{(-1)^n}{(1-4n^2)} = \cfrac {1}{4}(2-\pi)}$$
Suppose
$$
f(x)= \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n\cos(nx) + b_n\sin(nx)
$$
uniformly on $[0,2\pi]$. Then,
$$
\int_0^{2\pi}f(x)\cos x\,dx
=\int_{0}^{2\pi}
\left(\frac{a_0}{2} + \sum_{n=1}^{\infty} a_n\cos(nx) + b_n\sin(nx)\right)\cos x\,dx.
$$
But "uniform" convergence allows you the switch the integral and summation signs, which implies that
$$
\int_0^{2\pi}f(x)\cos x\,dx=a_1\int_{0}^{2\pi}\cos^2x\,dx=a_1\pi.
$$
With the exactly same argument,
$$
\int_0^{2\pi}f(x)\cos x\,dx=c_1\int_{0}^{2\pi}\cos^2x\,dx=c_1\pi.
$$
This tells you that $a_1=c_1$.
Similarly, you can show that $a_n=c_n$, by multiplying $f$ with $\cos(nx)$, and $b_n=d_n$, by multiplying $f$ with $\sin(nx)$.
Best Answer
We can use the generalized Bessel functions with an infinite number of variables, (see for example here). These functions are defined by \begin{equation} J_n\left( \left\lbrace \alpha_m\right\rbrace \right)=\frac{1}{\pi}\int_0^\pi \cos\left(n\theta-\sum_{m=1}^\infty \alpha_m\sin m\theta \right)\,d\theta \end{equation} where $\left\lbrace \alpha_m\right\rbrace $ are real coefficients such that the series $\sum_{m}m\left|\alpha_m\right|$ is convergent. They verify a Anger-Jacobi-like expansion \begin{equation} \exp\left(i\sum_{m=1}^\infty\alpha_m\sin m\theta \right)=\sum_{n=-\infty}^\infty e^{in\theta}J_n\left( \left\lbrace \alpha_m\right\rbrace \right) \end{equation} Then, one can obtain the desired result for a Fourier sine expansion. Similarly, for a Fourier cosine, \begin{align} I_n\left( \left\lbrace \alpha_m\right\rbrace \right)&=\frac{1}{\pi}\int_0^\pi \cos\left(n\theta-\sum_{m=1}^\infty \alpha_m\cos m\theta \right)\,d\theta\\ \exp\left(i\sum_{m=1}^\infty\alpha_m\cos m\theta \right)=&\sum_{n=-\infty}^\infty e^{in\theta}I_n\left( \left\lbrace \alpha_m\right\rbrace \right) \end{align} Many properties of these infinite variable Bessel functions were derived and methods of calculation were also given (see the works of Lorenzutta, Dattoli...).