Even though you took good notes and studied, you bombed a midterm exam. As awful as you feel, it really isn’t the end of the world.
Go see your professor
Ask him/her where you went wrong. Ask for advice on how to improve your grade in the future. Explain how you studied for the exam. He/she may have suggestions on how you can study more effectively.
Talk to your adviser or other academic counselor
Have you bombed tests in classes in your major before? If so, maybe you need to consider another major. Your adviser or academic counselor can help you decide if you’re in the right major.
Get some help
One way to avoid bombing another test is to get some help. There’s no shame in asking for assistance. Maybe you need some help fine-tuning your study skills. Or, maybe you need to work with a tutor. Most schools have academic centers where this kind of help is available. Swallow your pride and visit those folks.
Chin up. You’ll do better next time.