I just recently did this and removed the ballast and used ballast-bypass LEDs. Easy and more future proof.
In another fixture, the ballast was OK, so I used drop-in replacement LEDs, but if your ballast is bad, I would toss it and not replace it.
ETA: Here’s my recent thread on the subject: Utility Room Fluorescent Light Fixture