If you're just factorizing, you can do so by grouping.
cot³(x) + cot²(x) + cot(x) + 1
= cot²(x) (cot(x) + 1) + cot(x) + 1
= (cot²(x) + 1) (cot(x) + 1)
Put another way, if y = cot(x) + 1, then
cot²(x) y + y = (cot²(x) + 1) y
We can simplify this somewhat. Recall the Pythagorean identity,
sin²(x) + cos²(x) = 1
Dividing through both sides of the equation by sin²(x) reveals another form of the identity,
sin²(x)/sin²(x) + cos²(x)/sin²(x) = 1/sin²(x)
1 + cot²(x) = csc²(x)
Then we end up with
cot³(x) + cot²(x) + cot(x) + 1 = csc²(x) (cot(x) + 1)