Passing a class, then retaking it and getting a W?

During my freshman year of college, I took Chemistry 1 and I recieved a grade of a C (at my main college, a state university ).
Four years later, after I graduated from that college, I took chemistry 1 at a local community college (as review for a grad school I was applying to). I ended up withdrawing from the class due to health reasons while simultaneously working full time and I figured I already earned credits for the class when I took it and got a C (I even had an A when I withdrew–I regret withdrawing). Anyways, will my C in chem still count when I apply to grad schools? Or will taking the class at a community college (and getting a W in it) negate the C I originally got at my state university? It’s an odd situation. I am a good student with an overall undergraduate gpa of 3.6

No, it doesn’t “negate” the C. Your C still stands. If you need a strong understanding of chemistry and/or better grade specifically in a chemistry class for your long-range goals, then you probably do need to figure out how and when to take another chem class. If you just were re-taking chemistry because it is the one C grade on your record, and chemistry isn’t particularly pertinent to your grad school goals, that would be a different situation.