Have you tried going to your professor's office hours and have them review old exams with you and ask for ways you can improve on the upcoming exam(s)?
I used to be in a similar situation. I was also one course short to graduate from getting my degree. I was in an early college program and very close to getting my AA degree and graduating alongside my peers. The problem was, I was failing Physics. The professor's exams were really hard. Even the rest of the class agreed. We weren't even allowed to take our graded exams home. One day, I mustered up the courage to go to my professor's office hours to review one exam and changed the way I studied and used different test strategies. I redid all homework questions and study guide questions at least twice and timed myself. I also asked questions during lecture and took detailed notes. I went from a D to getting straight A's on the rest of the exams. I ended up with an A in the class.
It's possible to do if you work really hard. It also depends on how many assignments and exams are leftover so you can get as many points as possible. But even if you don't have much time or grading opportunities left, if you REALLY want to graduate on time, withdrawing isn't an option. If it's a required course, you don't want to take it a 3rd time now do you? If 2 is the max attempts allowed, you'll have to switch to another major that accepts most of the classes you've already taken.
The lack of confidence hurts, but once you start hitting the books and getting a hang of answering a variety of practice questions correctly, you'll gradually feel more confident. Do your best now. In addition to the tips I mentioned, go seek tutoring and watch YouTube videos if you're not understanding something. Good luck!