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.