General Question: To retake or not to retake and the impact

Hi guys, recently I’ve been wandering on google about the benefit of retaking a class and it’s impact for the transfer admission.

This summer i got a really bad GPA, Macroeconomics 3.2, Calc(3), 3.1, and Linear algebra 2.6. Unfortunately, those are my main pre-reqs and also my major courses to transfer to some uni, for example UC and CMU. Would it be safe to retake all those classes? or just retake the linear algebra? What’s your personal limitation on deciding which course to retake and which is not?

I assume that the overall GPA is the most important ones when it comes to transferring process

Thanks a lot!!