I'm really scared and anxious that I'm going to fail
Are you really? What are you afraid of failing at?
Nothing in particular, but there is always a chance that it could happen.
Everyone experiences the fear of failing at some point. However, you should not let this fear keep you stuck. Work on improving your self-esteem through skill building activities.
What if I just don't study for the test? If I don't do well, I'll just have to retake classes next year.
That is something that can definitely happen, but you don't have to keep beating yourself up over it. I believe in you that you can indeed study hard and achieve enough self-confidence to pass! Everyone feels the same way as you do, don't worry.