given a polynomial has roots x = a and x = b, then
(x - a) and (x - b ) are factors
given a root x = c with multiplicity 2 then (x - c)² is a factor
The polynomial is then the product of it's factors
here x = - 2 with multiplicity 2 and x = 3 are the roots, hence
(x + 2)² and (x - 3) are the factors
f(x) = k(x + 2)²(x - 3) ( k is a multiplier, in this case let k = 1 )
= (x² + 4x + 4 )(x - 3) = x³ + x² - 8x - 12 ← is a possible polynomial