Repeating a class in high school?

It’s my Pre-AP Algebra 2 class. I’m not entirely sure how my school is, I’m checking tomorrow, but I’m pretty sure that if I retake this course it will replace my current grade, right? I technically passed, since it was above an F, but if I can retake it and get a better grade, then it will raise my GPA significicantly. I took the class sophomore year, it was a one semester class. Is there any downside besides slowing down my math courses and not taking Calculus as a senior (which I wouldn’t want to much if I haven’t fully gotten Algebra 2 concepts). Also, if colleges see that I retook it voluntarily, will it look bad on me, since I didn’t do well the first time?