Answer
$y(x)=\frac{1}{\cos{x}}(\frac{1}{2}\cos{2x}+C)$
Work Step by Step
Given that:
$$y' = \sin{x} (y \sec{x} - 2)$$
Rewrite in terms of $\frac{dy}{dx}$ and multiply right side terms:
$$\frac{dy}{dx} = y \sin{x} \sec{x} - 2 \sin{x}$$
Put the equation in standard form: $\frac{dy}{dx} + P(x)y = Q(x)$
$$\frac{dy}{dx} + y (- \sin{x} \sec{x}) = - 2 \sin{x}$$
Find integration factor: $I(x) =e^{\int{P(x)} dx}$
$$I(x) = e^{\int{- \sin{x} \sec{x} dx}} = e^{- \int{\tan{x}} dx} = e^{-\ln{|\sec{x}|}} = \frac{1}{\sec{x}}=\cos{x}$$
Multiply both sides by integration factor:
$$[\frac{dy}{dx} + y (- \sin{x} \sec{x})] \cdot \cos{x} = [- 2 \sin{x}] \cdot \cos{x}$$
Rewrite left side as $\frac{d}{dx}[I(x)y]$:
$$\frac{d}{dx}[(\cos{x})y] = - 2 \sin{x} \cos{x}$$
$$\frac{d}{dx}[(\cos{x})y] = - \sin{2x}$$
Integrate both sides:
$$\int{\frac{d}{dx}[(\cos{x})y]} = \int{- \sin{2x}}dx$$
$$(\cos{x})y = \frac{1}{2} \cos{2x} + C$$
Solve for y:
$$y=\frac{1}{\cos{x}}\left(\frac{1}{2}\cos{2x}+C\right)$$