The acceleration/deceleration always points forward. If you've turned in other directions, then you can end up with some lateral velocity. You can cancel it out by decelerating until your speed hits a minimum, turning roughly 90 degrees, and decelerating along that axis as well. (If you still have residual speed, just repeat with more roughly-perpendicular axes.)