x3 - 125 = x3 - 53
This is a difference of cubes which has a standard factoring formula:
a3 - b3 = (a-b)(a2+ab+b2)
In your case, a = x and b = 5, so we get:
x3 - 53 = (x-5)(x2 + 5x + 25)
which is as far as it can be factored.
-----
x3 - 6x2 - 9x + 54
Factor by grouping:
(x3 - 6x2) - (9x - 54)
x2(x - 6) - 9(x - 6)
(x2-9)(x-6)
Now (x2 - 9) is a "difference of squares" which factors to (x+3)(x-3). So the final factored form is:
(x+3)(x-3)(x-6)