Why do you think you’ve done poorly thus far? If it’s simply that you haven’t been putting enough time into the class, then you should be able to get your grade up by committing more time to it each week. If you have been putting time and effort into it and you’re still having trouble understanding the material, then your grade is likely to remain a D. You should withdraw in this latter case.
But first call admissions to hear what they have to say. Ask if they would allow you to retake the class in the summer.