Keep your guitar out of a hot or humid place and try not to move your guitar from two different climates instantly. Also you should by a protective case (soft or hard) and a stand to protect it when you're not playing your guitar. By a strap so you can not drop it whilst playing. Also you should keep it away from minors or people who don't know how to respect your stuff. Try to wash your hands before playing because it stops your strings and the neck of the guitar getting dirty and greasy. Clean your guitar in spare time so it keeps it clean. Do not leave a capo on it. Tune it regally and take in to your local guitar shop and get him/her to do a monthly check up on it (if it's free) and try not to drop your guitar.
If you run your fingers down the sides of the neck and you can feel the frets poking out that means it's drying out. If your guitar goes out of tune very quickly than take it to your nearest guitar shop and show them or tell them what is happing and the will probably tighten the neck up with Allan/Hex key. If you follow every thing I have written here your guitar should last longer.