Guitars are very durable, very delicate instruments. They're hard to break, but easy to ruin. I have a guitar that's survived being sat on, dropped from a second-story balcony, and rescued from a burning car and a burning house. I've also seen a guitar pull itself to pieces when a friend kept it under a window next to a heat vent -- the constant temperature changes made all the joints separate. Another one, which I found in a basement, splintered when I put strings on it. It was covered with mold on the inside.
Keep your guitar in a place with reasonably constant temperature and humidity. Inside the case is best, but if you're like me, you'll have the guitar out too often to make that worth the trouble. In that case, a guitar stand is a good investment. Leaning your guitar against things is asking to have it knocked over, especially if you have pets or children. Even if it's in the case, don't leave your guitar lying on a floor that gets cold or against an outside wall. Don't keep it in a hot attic or a damp basement. Don't leave it in the trunk of your car. Use common sense.
Keep a soft cloth on hand. Skin oil will corrode your strings, so wipe them down after you play. They'll last longer. If your guitar is dusty or smudged, wipe it with a soft cloth, damp or otherwise. It does not need to be polished. Polish leaves a residue that can build up over time and affect your guitar's sound.
If you travel with your guitar, you should get a better case and follow all of the above rules. Don't check your guitar as baggage if you can manage it. That's especially true on planes. I've heard different stories about why you shouldn't check your guitar when you fly. Some people say it's because the temperature and air pressure changes in the cargo hold can destroy your guitar. That's probably true, although I've done it without any noticeable effect on the guitar. I've also heard that it's because baggage handlers will fling a safe on top of it and crush it. That's probably also true, although again, I've done it without incident. Either way, it's probably a bad idea. If you're not willing to risk your guitar, you're better off not checking it.
There are a few options.
No matter what else you do, if you take your guitar on a plane, loosen the strings.
If you absolutely can't get around checking your guitar, the best thing you can do is buy it a flight case. These cases are airtight, indestructible, heavy, and extremely expensive. You might pay more for a flight case than you did for your guitar. On the other hand, if you buy one, not only will your guitar survive the cargo hold, it will have a good chance of surviving a midair collision.
If you can't afford a flight case, at least have a hardshell case. Do not check your guitar in a cardboard case or a gig bag. If the case doesn't fit snugly, wrap the guitar in towels. You don't want it to rattle around at all, and you do want it to be well enough protected that if a heavy suitcase or two get thrown on top of it, it won't be crushed.
In the past, guitar strings were made of either wire or gut. (Gut strings were usually called catgut, but were actually almost always made from sheeps' intestines.) These days, strings are usually made of steel or nylon. Steel strings are used for both electric and acoustic guitars. Nylon strings are usually used only on acoustic classical guitars, but recently some manufacturers have begun to make electric classical guitars, which also use nylon strings.
It's not a good idea to use the wrong kind of strings for your guitar. Steel strings on a classical guitar will warp or break its neck, and nylon strings on a steel string guitar won't have the correct tension for the guitar's neck, so your intonation will be off. Make sure you're using the right kind of strings before you change them.
A steel guitar string's diameter is called its gauge. Sets of strings are graduated so that their tension is as consistent as possible when they are in tune, to offer an even resistance when you play them. They are usually sold in sets, labeled things like "Extra Light," "Light," "Medium," or "Heavy." (Those aren't the only gauges they come in, just the most common.) Every manufacturer has a different definition of what those labels mean, so don't expect Dean Markley extra light strings to be exactly the same gauges as Gibson extra light strings. If you can't find a set of strings whose gauges suit you, you can buy individual strings in the exact gauges you like.
Changing the gauge of the strings will affect the guitar's sound and feel. Lighter gauge strings have a lower tension, and are easier to press down onto the frets. They are also harder to keep in tune, and they give less volume and sustain. Heavy gauge strings are the opposite -- harder to play, easier to keep in tune, more volume and sustain. You may want to take all of these things into account when you buy guitar strings.
One important note; if you have a very old acoustic guitar, it's best to use light or extra-light strings. Medium and heavy gauge strings are a relatively recent invention, and older guitars (aside from being made from older wood) aren't built to take that kind of tension. Some Martin guitars have an inscription in the soundhole that says "use only light gauge strings." They aren't just saying that to be annoying.
Nylon strings come in different "tensions." The different tensions are called "hard," "medium," or "light." Varying the tension of the strings affects the feel and sound of the strings. For instance, most flamenco strings are "hard," because a tight, crisp feel is suited to the style of music.
You should change your guitar's strings regularly, even if you don't play very often. Over time guitar strings lose elasticity. That increases the tension on the guitar's neck, which can cause it to warp. When you do play a lot, the strings also become corroded and lose their tone and brightness. If you play for an hour or more a day, it can take as little as a week or two for your strings to lose their tone and elasticity.
It should be reasonably obvious how to attach the strings to your guitar. Look at the ones that are already there. The new ones go on the same way. On steel-string acoustics, the pegs can be hard to remove. They're cheap and easy to replace, so I just pull mine out with pliers. If the thought of having any flaw on your guitar bugs you that much, there are two things you can do. One is to buy a string winder and try to master the use of the peg remover. The other is to put your guitar on the floor and drop your keys on it. Once there's a ding or two in the finish, you'll think much more clearly.
The most important thing to know about changing strings is replace one string at a time. While it won't necessarily ruin a guitar if you remove the strings all at once, it won't do it any good either. Obviously there are some repairs that require all the strings to be removed, and any guitar in good condition should be able to take it -- but why put unnecessary stress on your instrument? If you replace one string at a time, you maintain an even tension on the neck and bridge. Here's a good way to change strings:
When you finish, your guitar will be horribly out of tune anyway. That's because each time you change a string, the tension on the neck changes a little bit, and that causes the tuning of the other strings to change. This way, though, you won't be as far off as you would have been if you had changed all six strings at once.
Every so often, you may want to do some basic maintenance on your guitar. None of these things are necessary, but all of them are useful. I'll describe what I do once every six months or so.
If you don't expect to be playing your guitar for several months or longer, you should store it carefully inside its case with the strings loosened. Be sure to put it somewhere dry and temperate, like a closet. There's no need to change strings if you won't be playing it, as long as they've been loosened.