From the familiar identitiea
$$\sin(A+B)=\sin A\cos B+\cos A\sin B$$
$$\sin(A-B)=\sin A\cos B-\cos A\sin B$$
$$2\cos A\sin B=\sin(A+B)-\sin(A-B).$$
Set $B=\sin(x/2)$ and $A=\cos(kx)$. We get
Add up, $k=1$ to $k=n-1$. There is a lot of cancellation (telescoping) on the right. The only surviving part is $\sin((n-1/2)x)-\sin(x/2)$.
Remark: The method doesn't quite work if $\sin(x/2)=0$, but then finding the sum of the cosines is easy. The closed-form formula is "almost" right even for these $x$, in the sense that it has the right limit.
A similar trick, using the addition law for cosine, gives a closed-form expression for $\sin x+\sin 2x+\cdots+\sin((n-1)x$.