I have some difficulties understanding the last step of the screenshot.
The first step is to multiple the conjugate of the numerator. The second step is to use $1 - \cos^2(x)$ to get $\sin^2(x)$.
How and why did the author splits the $\dfrac{\sin^2x}{x(1+\cos x)}$ into a limit with two functions in it.
Can anyone help to explain the intentions and how it is derived?

It is known that $\lim_{x \to 0} \frac{\sin x}{x}=1$ and taking that term out make things clearer as now when we substitue $0$ into the denominator, we no longer get $0$ but the numerator still give us $0$.
Since $\lim_{x \to 0} \frac{\sin x}{1+\cos x}=0$, the overall limit is $0$.