brakes keep failing while driving on 2002 Audi A4

no power to brakes on a few occasions brake pedal goes hard while trying to brake

1 answer
have brake booster inspected.