Here's how I would motivate the solution:
First, the problem will be VASTLY simpler if you replace $\cos(nx)$ with one half the sum of a positive and negative complex exponential and $\sin(nx)$ as one half the difference between the positive and negative complex exponential, and then once the two series are expressed in terms of complex exponentials, then multiplication of Fourier terms becomes easy.
That's because the coefficient of the $m$-th term in the product will contain terms from the two multiplier series whose indices add to $m$, such as $(m-2,2)$, $(m-1,1)$, $(m,0)$, $(m+1,-1)$, $(m+2,-2)$, and so on, where the first index in each pair refers to the first series and the second index refers to the second series, and this is where the convolution on indices comes from.
Ok, here I am. The goal is to compute the Fourier series of $g(x)=\log\sin x$ over $[0,\pi]$, or the Fourier series of $h(x)=\log\sin\frac{x}{2}$ over $[0,2\pi]$, or the Fourier series of $f(x)=\log\cos\frac{x}{2}$ over $[-\pi,\pi]$. Since $f(x)$ is an even function, we have to compute:
$$ a_n = \frac{1}{\pi}\int_{-\pi}^{+\pi}\cos(nx)\log\cos\frac{x}{2}\,dx = \frac{2}{\pi}\int_{0}^{\pi}\cos(nx)\log\cos\frac{x}{2}\,dx$$
for any $n\geq 1$ to be able to state:
$$ f(x) = \frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)\,dx + \sum_{n\geq 1}a_n\cos(nx)=\frac{a_0}{2}+\sum_{n\geq 1}a_n\cos(nx).$$
for any $x\in(-\pi,\pi)$. Integration by parts gives:
$$ a_n = \frac{2}{\pi}\left(\frac{1}{n}\left.\sin(nx)\log\cos\frac{x}{2}\right|_{0}^{\pi}+\frac{1}{2n}\int_{0}^{\pi}\sin(nx)\tan\frac{x}{2}\,dx\right)$$
or just:
$$ a_n = \frac{1}{\pi n}\int_{0}^{\pi}\frac{\sin(nx)\sin(x/2)}{\cos(x/2)}\,dx = \frac{2}{\pi n}\int_{0}^{\pi/2}\frac{\sin(2nx)\sin x}{\cos x}\,dx.$$
Since $\cos((2n+1)x)=2\cos x\cos(2nx)-\cos((2n-1)x)$, we have:
$$ a_n = \frac{1}{\pi n}\int_{0}^{\pi/2}\sum_{k=1}^{n}\cos((2k-1)x)\,dx =\frac{(-1)^{n+1}}{n}.$$
This gives:
$$\log\cos\frac{x}{2}=\frac{a_0}{2}+\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}\cos(nx)$$
for any $x\in(-\pi,\pi)$. In order to find $a_0$, we can simply match $f(0)=0$ with the series on the right hand side. Since:
$$\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}=\int_{0}^{1}\frac{dx}{1+x}=\log 2,$$
we have:
$$\log\cos\frac{x}{2}=-\log 2+\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}\cos(nx)\qquad\forall x\in(-\pi,\pi),\tag{1}$$
and by translating the variable:
$$\log\sin\frac{x}{2}=-\log 2-\sum_{n\geq 1}\frac{1}{n}\cos(nx)\qquad\forall x\in(0,2\pi),\tag{2}$$
$$\log\sin x = -\log 2-\sum_{n\geq 1}\frac{1}{n}\cos(2nx)\qquad\forall x\in(0,\pi),\tag{3}$$
as wanted.
A little addendum, since I think it is worth mentioning the following technique. Starting with a celebrated identity:
$$\prod_{k=1}^{n-1}\sin\frac{\pi k}{n}=\frac{2n}{2^n}$$
and noticing that $\log\sin x$ is a Riemann integrable function over $(0,\pi)$, we have:
$$\int_{0}^{\pi}\log\sin x\,dx = \lim_{n\to +\infty}\frac{\pi}{n}\sum_{k=1}^{n-1}\log\sin\frac{\pi k}{n}=\lim_{n\to +\infty}\frac{\pi}{n}\log\frac{2n}{2^n}=\color{red}{-\pi\log 2}.$$
Best Answer
Informally you can recover the coefficient by averaging both sides against $\sin mx$:
$$\frac{1}{\pi}\int_{-\pi}^{\pi}\left( a_0 + \sum_{n=1}^\infty a_n\sin(nx) + b_n\cos(nx)\right)\sin(mx)\, dx =\frac{1}{\pi}\int_{-\pi}^\pi 4\sin x \sin (mx)\, dx, $$ because the left hand side becomes then
$$a_0 \frac{1}{\pi}\int_{-\pi}^\pi\sin(mx)\, dx+ \sum_{n=1}^\infty a_n\frac{1}{\pi}\int_{-\pi}^\pi\sin(nx)\sin(mx)\, dx+b_n\frac{1}{\pi}\int_{-\pi}^\pi\cos(nx)\sin(mx)\, dx =a_m $$
while the left hand side is $4\delta_{1m}$. This procedure, similar to the original reasoning by Fourier, requires the interchange of integral and sum in left hand side, which can be done if the series converges uniformly. However, that request is excessively restrictive: turns out that convergence in $L^2$ sense will suffice. This can be proven by means of Hilbert space methods.