You need to do long division, just like you would for polynomials with rational/real coefficients. (We can even do synthetic division!) Or you can do it on the fly:
We have $f(z) = z^3 + (-6+2j)z^2 + (12-15j)z + (-9+27j)$
Now, if we write $f(z) = (z-3)(\text{something})$, the something will have to be of degree $2$. So it will be of the form $az^2+bz+d$.
Now, to get the cubic term right, $az^2$ has to be $z^2$. So we will have: $z^3 + (-6+2j)z^2 + (12-15j)z + (-9+27j) = (z-3)(z^2+\cdots).$ Now, when you multiply $-3$ times $z^2$, you'll get $-3z^2$. What you actually want is $(-6+2j)z^2$, so that means that the linear term $bz$ should be such that when you multiply by $z$ to get $bz^2$, you'll have $bz^2-3z^2 = (-6+2j)z^2$. So $b$ should be $-3+2j$. So we have: $z^3 + (-6+2j)z^2 + (12-15j)z + (-9+27j) = (z-3)(z^2 + (-3+2j)z + \cdots).$ When you multiply $(-3+2j)z$ by $-3$, you'll get $(9-6j)z$; what you want to get is $(12-15j)z$. So the missing $(3-9j)z$ must come from multiplying the $z$ in $(z-3)$ by the constant term. So the constant term must be $3-9j$; that is, $z^3 + (-6+2j)z^2 + (12-15j)z + (-9+27j) = (z-3)(z^2+(-3+2j)z + (3-9j)).$ Now verify that we get the "right" constant term: $-3(3-9j) = -9 + 27j$. Good. So we're done.
(You can also do this to write the quotient-with-remainder, by proceeding as above, and then just adding whatever is "left over" to make the equality work.)