Working on a robot, need some help with the coding aspect

Can you please provide links to your motors and the motor driver(s) you're using and a schematic showing how they're all connected to the Arduino.

I bet there's plenty of information available for the motor driver to tell you how to stop the motors. But without any information about what you're trying to use there's not a lot we can do.

Steve