Whether your hot water tank is gas or electric, you can extend the life of the tank beyond the manufacturers normal life expectancy. This is simply done by replacing the sacrificial anode rod. There are several videos available on youtube that explain how to do this safely. The rod itself will generally cost between $20-50. If you are the handy type, this will be a quick simple job.
The purpose of the anode rod is to keep the inside of the tank from corroding, by drawing the corrosive elements to the rod itself. When the rod becomes so corroded, it can no longer do its job, the tank will start to corrode. The anode rod lasts 4-6 years depending on the composition of your water.