Dropping a class with a W

So im taking summer 1 classes right now. I just failed a mid-term in one of my classes which will make it extremely difficult for me to get anything higher than a C in the class. The weekly homework for that class takes me 7+ hours to do and I studied extremely hard for the exam. I have a 3.9 overall GPA and I don’t want this class to bring my GPA down significantly. Would it be better to take a W or work hard and try to get a C.