If your brakes fail while you are driving, you should first:

If your brakes fail while you are on the road, your first response should be to switch into a lower gear and begin to pump your brake pedal to build up pressure to stop your vehicle. Find a safe place to stop the vehicle and do not drive it again until the brakes have been fixed.
DMV Writen Test