The best way to prolong the lifespan of your AC unit is to keep it clean, maintained, and free from debris both inside and out. Do not run it at too cold a temperature if it is not necessary, and turn it off when you can handle the indoor temperature—such as evenings when the outdoor temperatures drop.
If you have a technician come in for a maintenance check, you could have him include duct cleaning if that is included in your agreement. If not, you should check into that and do it every few years to help keep out pollutants and excess dust and build up that can make your air conditioner have to work harder than it should.
If you have a HVAC system, or one that heats and cools the home, it is advisable to have the unit inspected before the start of each season, winter and summer. If you have an older system that is due to be replaced, you should consider purchasing a ductless system or one that is more energy efficient and made to last longer than the traditional models.
If you have window units installed in your home, you may want to consider going with a central unit. A central unit can cost thousands of dollars, but it will pay for itself with savings on your electric bill. A central unit will also help maintain a more consistent temperature in your home.