Re taking a class

This term I got a D in geometry I’ve been very stressed about it and I was wondering if I can retake the class even though I did not fail it. And if I get good grades for the remaining terms can I just re take that one term I got a d in?

You should check with your school. Different systems deal with this differently. Of course you can always take it as sa summer class but your question is probably about how it will be dealt with in terms of your GPA. You need to ask your guidance counselor about that because schools differ.