Notice that the condition x ≠ 2πk for (presumably) integer k means cos(x) ≠ ±1, and in particular cos(x) ≠ 1 so that we could divide both sides by (1 - cos(x)) safely. Doing so lets us separate the variables:
(1 - cos(x)) y' - y sin(x) = 0
==> (1 - cos(x)) y' = y sin(x)
==> y'/y = sin(x)/(1 - cos(x))
==> dy/y = sin(x)/(1 - cos(x)) dx
Integrate both sides and solve for y. On the right, substitute u = 1 - cos(x) and du = sin(x) dx.
∫ dy/y = ∫ sin(x)/(1 - cos(x)) dx
∫ dy/y = ∫ du/u
ln|y| = ln|u| + C
exp(ln|y|) = exp(ln|u| + C )
exp(ln|y|) = exp(ln|u|) exp(C )
y = Cu
y = C (1 - cos(x))