The #-# sign in the question should be a #+#.
#1/(1-cos theta)+1/(1+cos theta)#
#= (1/(1-cos theta))((1+cos theta)/(1+cos theta)) + (1/(1+cos theta))((1-cos theta)/(1-cos theta))#
#= (1+cos theta)/(1-cos^2 theta) + (1-cos theta)/(1-cos^2 theta)#
#= ((1+cos theta) + (1-cos theta))/(1-cos^2 theta)#
#= 2/(sin^2 theta)#
#= 2(1/sin^2 theta)#
#= 2(1/sin theta)^2#
#= 2csc^2 theta#
If you try the same thing with #1/(1-cos theta)-1/(1+cos theta)# you will get the result #2 cos theta csc^2 theta#.