You should not panic, and keep the brake engaged
You should release both brakes and coast to a stop
You should release the front brake and only use the rear brake
You should release the brake immediately and re-apply the brake smoothly