If you fail, you better pull yourself up and try it again. It's not the end of the universe that you have to take a class.
Study harder, talk to other studants that do well in class, talk to the teacher about getting some tutor time perhaps, and work at it.

Wailing that you're going to take your toys and go home isn't going to get you any better in a math class. Declaring that you'll drop out just because you have a set-back makes you seem short-sighted.
What will you do when you drop out? Sit on your hands until you have to go get a minimum wage job with no future?
Try putting all the energy you are wasting on melodrama into working hard on math instead. If you failed a math class, then you failed it. Work harder at it and pass it.
Sorry if this comes off as harsh, but you shouldn't toy with your future. You're getting a free education, take advantage of it.