You write:

x^3 - 2x^2 - 5x + 6 = (x+2)(ax^2 + bx + c)

Multiply out the Right Hand Side:

x^3 - 2x^2 - 5x + 6 = a x^3 + x^2 (2 a + b) + x (2b + c) + 2c

So the coefficients of x^3, x^2, x, and the constant terms must be equal, so:

from the first and last terms:

a=1, c=3,

and from the term in x we have:

2b+c = -5,

or 2b= -8, so b=-4, and:

x^3 - 2x^2 - 5x + 6 = (x+2)(x^2 - 4x + 3)

RonL