My AC has been running smoothly for about 9 years now. Here is what I do:
I run my AC regularly, even in the winter, at least 15 minutes a week
I clean my air filter as often as I can
I keep my car dry and avoid excess moisture (and as clean as possible)
Yearly checkups, inconvenient but, in my opinion very worth it, as they have saved me money in the long run.