The Quotient Rule for derivatives states:

If #f(x) = g(x)/(h(x))#

then

#f'(x) = (g'(x)h(x) - g(x)h'(x))/(h(x))^2#

SEE: https://en.wikipedia.org/wiki/Quotient_rule

So, the first step is to identify #g(x)# and #h(x)# in your original function:

#f(x) = sin(x)/(1- cos(x))#

so

#g(x) = sin(x)#

#h(x) = 1- cos(x)#

We then differentiate the two components of #f(x)# with respect to #x#:

#g'(x) = cos(x)#

#h'(x) = -(-sin(x)) = sin(x)#

Let's combine all of the pieces, based on the Quotient Rule, and then simplify:

#f'(x) = (g'(x)h(x) - g(x)h'(x))/(h(x))^2#

#f'(x) = (cos(x)(1- cos(x)) - sin(x) sin(x))/(1- cos(x))^2#

#f'(x) = (cos(x) - cos^2(x) - sin^2(x))/(1- cos(x))^2#

#f'(x) = (cos(x) - (cos^2(x) + sin^2(x)))/(1- cos(x))^2#

#f'(x) = (cos(x) - 1)/(1- cos(x))^2#

#f'(x) = (cos(x)- 1)/((-1)(1- cos(x))(-1)(1- cos(x)))#

#f'(x) = cancel(cos(x) - 1)/(cancel((cos(x) - 1))*(cos(x) - 1)#

#f'(x) = 1/(cos(x) - 1)#