>If F=ma, then surely the force is always 0

No, it's not, because car is stopped from initial speed to rest, yes ? Then it HAD negative acceleration.
$$ F=ma=m\frac{dv}{dt}=m\frac{\Delta v}{\Delta t}=m\frac{v_e-v_0}{\Delta t} $$
$v_e=0$ (final speed), in your case because object stops car fully, so :
$$ F = m \frac{-v_0}{\Delta t} $$

Thus put 40 mph and 30 mph into $v_0$ and you will get an answer. Btw, minus sign means that force vector is directed in opposite direction that car initial speed was directed at.