This is called the minimax approximation problem and we will use some geometry to help us solve this problem. First define
$$\epsilon(x)=2x^3+x^2+2x-1-(ax+b)$$
So looking at this picture here, the blue curve is the cubic function we are trying to approximate. And the purple curve is what our minimax approximation should roughly looks like. Let us define the max absolute error
$$\rho=\max_{-1\leq x \leq1}|\epsilon(x)|$$
we also see here that this max error is achieved exactly at three points
$$\epsilon(-1)=\rho=\epsilon(1) \textrm{ and } \epsilon(x_1)=-\rho$$
where I have the fat red vertical line at $x=x_1$. In addition, $\epsilon(x)$ achieves its minimum at $x=x_1$ so we have $\epsilon'(x_1)=0$. So now we solve four equations with four unknowns (a nonlinear system in this case) and get
$$a=4,b=\frac{-35-13\sqrt{13}}{108},x_1=\frac{-1+\sqrt{13}}{6},\rho=\frac{35+13\sqrt{13}}{108}$$
or better yet
$$a=4,b=-0.758076,x_1=0.434259, \rho=0.758076$$
so we know what the minimax line is, what the max error is and where is it achieved. In case you get two solutions while trying to solve this system, then remember to pick the solution where $\rho$ is positive.
Oh and the algorithm you are looking for is Remez algorithm and you might also want to look at