Feel like a loser and giving up- Need help

I am having a terrible time with my course. I got only 47% in midterm worth 35 % and in assignments, I will get around 22% out of 25% . My final is worth 40% , I don’t know what to do. I am feeling anxious about it because I already have a very low gpa of 3.0 to 3.1. Can anyone tell me, if I still can get a good grade like around b or b plus. I really need it, please advise. The grading is based on the curve and is competitive.