So the brake pedal goes randomly "Hard" when you try to press it? of something else?
Normally the brake pedal becoming hard to press is the result of a bad brake booster or vacuum line leak.
Hopefully you get it sorted, if you have your phone make a video of it next time it happens