The most important thing to do before dropping a class or having a mental breakdown is to assess the situation. Check your grades online, and figure out what your average to date. If you're close to passing and still have two tests to take in the future, it's likely you can still pass if you study your ass off. If you only have a few small assignments left to raise your average, you may have to take more drastic measures.