When you add a motor to the Devices, you’ll see the Motion blocks for the motor appear. Then you can use the ‘set motor stopping’ block:
(From VEXCode Help)
This will set the behavior of the V5 Smart Motor once it stops moving.
Brake will cause the Motor to come to an immediate stop.
Coast lets the Motor spin gradually to a stop.
Hold will cause the Motor to come to an immediate stop, and returns it to its stopped position if moved.
The set motor stopping will take effect for all future motor commands for the rest of the project.