[tex]f(x)=ax^3+bx^2+cx+d[/tex]
has derivative
[tex]f'(x)=3ax^2+2bx+c[/tex]
We want this to have critical points at [tex]x=2[/tex] and [tex]x=-1[/tex]; we want [tex]f'[/tex] to be 0 or undefined at these points. Since [tex]f[/tex] is a polynomial, it is continuous, so the derivative will always exist.
So we need
[tex]\begin{cases}12a+4b+c=0\\3a-2b+c=0\end{cases}[/tex]
We also want [tex]f(0)=1[/tex] and [tex]f'(0)=6[/tex]. This means
[tex]\begin{cases}d=1\\c=6\end{cases}[/tex]
so the previous system reduces to
[tex]\begin{cases}6a+2b=-3\\3a-2b=-6\end{cases}\implies a=-1,b=\dfrac32[/tex]
So the function is
[tex]\boxed{f(x)=-x^3+\dfrac32x^2+6x+1}[/tex]