To swerve correctly:

To execute a swerve, press the handgrip on the side of your desired turn. Press on the opposite handgrip to return to your original direction after you are clear of the hazard.
DMV Writen Test