If you own a laptop, you’ll need to maintain the battery to protect it from premature failure. All laptops have a battery. Some of them have a removable battery, whereas others have a permanent and nonremovable battery. Regardless, your laptop will draw power from the battery when it’s not plugged into a wall outlet.

Laptop batteries don’t last forever. Research shows that most of them last for about two to five years. By the end of a five-year period, most of them will fail to hold a charge. You may still be able to use your laptop, but you’ll have to keep it plugged into a wall outlet. Rather than waiting until the battery has failed, you should consider the following tips to maintain it.

Don’t Deplete It

Try to avoid fully depleting your laptop’s battery. Laptops use lithium-ion (Li-ion) batteries. When fully depleted, Li-ion batteries will degrade. Constantly depleting the charge over the course of many months can take a toll on your laptop’s battery. You can make it last longer, however, by keeping the battery at least somewhat charged. Even if it’s just 10%, a small charge will protect the battery from premature failure.

Don’t Fully Charge It

Another maintenance tip is to avoid fully charging your laptop’s battery. In other words, don’t charge it to 100%. What’s wrong with charging the battery to 100% exactly? Fully changing it will shorten its lifespan. Li-ion batteries work best when charged just under their full capacity. Instead of charging the battery to 100%, try to charge it to 80% or 90%.

Keep It Cool

You should keep your laptop battery cool. Laptop batteries can overheat. During use, they will naturally generate heat. If the heat remains trapped and is unable to escape, the battery may heat up to the point where it fails. You can protect your laptop’s battery from premature failure by keeping it cool. Make sure there are no obstructions around it. And if possible, position your laptop in an open area where air can reach the battery.

Install Battery Management Software

There’s software available that can help you manage your laptop’s battery. Known as battery management software, it comes preinstalled on many laptops. You can use it to test the health of your laptop’s battery and also troubleshoot common problems. If the battery is beginning to fail, the software can reveal tips on how to extend its life.