At my school you take a remediation exam, which for most courses you schedule with the course director at your leisure over the following summer. You can get help with tudors, etc.
If you don't pass the class, you have to retake the class. If you failed more than one, or if you repeated classes in M1 and then failed an M2 class as well, the administration may request that you repeat all of the classes for that year. Over here, you can't advance to M2 without passing all M1 courses, and the same goes for following years.
Also, one thing to keep in mind is that if you only retake one class, you may not get any financial aid, so for some people it's advantageous to repeat all the classes rather than just one.
Basically, don't fail if you can avoid it, and if you do, study really really hard for the remediation exam (or the remediation course, if it's offered). You never know when you might fall in love with a competitive specialty, so study really hard for Histo. It's pretty much all memorization and recognition, so there's no reason if you put in the time that you can't pass (if you're grade is still in redeemable range). Buy some Netter Histo flashcards--they helped me.