Replace the ballast in four steps.
Photo 1: Remove the bulbs and fixture cover
Unplug the fixture or turn off the power at the main panel. Remove the ballast compartment cover to expose the internal wiring and ballast. The attachment method for ballast covers varies widely among manufacturers. It may be attached with nuts or clips or simply snapped into place.
When your fluorescent light flickers or makes a loud and annoying hum, a degrading ballast is the cause. The ballast takes in electricity and then regulates current to the bulbs. A typical ballast will generally last about 20 years, but cold environments and bad bulbs can decrease this lifespan significantly. You can get a new ballast at a hardware store or home center and install it in about 10 minutes. However, buying a ballast can be expensive, so consider pricing a brand-new fixture for comparison.
Start by flipping off the circuit breaker or unplugging the light. Remove the bulbs and open up the fixture as shown in Photo 1. There will be four to eight wires coming out of the ballast. Photos 2 and 3 show how to remove the old ballast from the fixture. Confirm that the new ballast matches the old one (photo below) and then install it as shown in Photo 4. After mounting the new ballast, replace the ballast compartment cover and bulbs, and it should be good for another 20 years.
Caution: Turn power off at the main panel before performing this repair.
Buying a New Ballast
Take the old ballast to the store with you. Compare the new and old ballasts to verify that the wiring diagrams, voltage and current match before installing the new ballast.