A cubic function has three roots, so in factored form it would look like
f(x) = ( ) ( ) ( )
We know one of the roots is -3, so one of the factors is (x+3)
f(x) = (x+3)( )( )
Since the root 2i is given the root -2i also has to exist.
f(x) = (x + 3)(x - 2i)(x + 2i)
If you want to simplify, it becomes
f(x) = (x + 3)(x^2 + 4)
f(x) = x^3 + 3x^2 + 4x + 12