I know how to do them when there is only linear factors in the denominator but when it has a repeated linear factor and a single linear factor then I get confused.

In my book it has this example (I will provide a picture since it's too long to type)

I can understand where it splits it up into A,B and C but when I get confused is when they do

$\displaystyle x=1$ and let $\displaystyle x=-1$

Are they just pulling random numbers from no where or something? How does that part work?