By default at power-up, the circuit is in coast mode.
To brake, set IN A to 0 V, IN B to 0 V, and Q5 to 5 V.
To spin clockwise, set IN A to 5 V, IN B to 0 V, and Q5 to 5 V.
To spin counterclockwise, set IN A to 0 V, IN B to 5 V, and Q5 to 5 V.
At any time you can return to coast by applying 0 V to Q5.
Or, you can apply pulses of 0 V/5 V/0 V/5 V (and so on) to control the speed.
The more time spent at 5 V, the faster the motor will spin.
Whenever you change modes, if you set Q5 to 0 V before making changes to IN A and IN B
(and then set Q5 back to 5 V or pulsing) there will be no shoot-through.