No matter how careful you are, you're going to have to deal with it sometimes. Your walls are going to develop small cracks from the natural settling of your house, they'll get nail pops, or they'll get dinged, and you are going to have to repair them.
Repairing drywall is not a difficult job. However, it is one of those jobs that can be a real pain because even a small repair can take more time for set up and clean up than doing the actual repair. The good news is everything you need for most small repairs is readily available, and since we are talking about drywall, it's not expensive.
Don't Sweat the Small Stuff
Small cracks from house settling and nail holes left from hanging pictures only require a thin coating of joint compound spread smoothly with a putty knife. After the compound dries, just sand it smooth with 120 grit sandpaper, and you are ready to paint.
A more frustrating problem is dealing with nail pops. You can drive the "popped" drywall nail back in, but over time, it will just pop out again. You will have to make sure the drywall is securely fastened to the underlying wall studs, which will stop the nail pops.
Do this by driving new drywall nails into the wall stud two or three inches from the existing nail pop. These new nails will help hold the drywall securely to the stud and stop the movement that is causing the pop. Set these nails slightly below the surface of the drywall, and then patch the holes using drywall compound. Once again, spread it smoothly, let it dry, sand, and you are ready to paint.
Patching Larger Holes
If you are dealing with larger holes, you have a couple of options. If the hole is relatively small, you can put fiberglass mesh drywall tape over the hole, and then put drywall compound onto the tape. Blend two or three layers of drywall compound over the hole, feathering the edges out onto the undamaged portion of the wall (thin layers dry better than thick layers), sand it smooth then paint it. Be sure to let each layer dry before you apply the next layer because if the drywall compound has not dried properly, it will crack, and you will be right back where you started. A good rule of thumb is to allow each layer of compound 24 hours to dry before applying another layer. Also, when dealing with larger holes, a wider putty knife makes it easier to feather out your joints.
Sanding drywall compound is dusty and messy. Thankfully, you don't have to sand between intermediate layers - just use your putty knife to scrape off any bumps or ridges once a layer has dried. After the final coat has dried, use relatively smooth sandpaper (120 grit), so your finished repairs will be nice and flat, just like your existing walls.
If you are dealing with a hole larger than two inches, you are going to have to make a patch. The process is to cut a piece of drywall approximately the same size and shape as the hole (just a little smaller), put the patch into the hole, and then fill the gaps around the patch with joint compound. Since most people don't keep spare drywall around the house, it's good to know that you can usually get relatively small pieces at home improvement stores. Called "culls," these are pieces of drywall that have been broken in shipment and the stores want to get rid of them. Culls should only cost a couple of dollars for a piece approximately 2' by 2', a manageable size for a homeowner to deal with.
The challenge when patching a hole is actually holding the drywall patch in place while the compound dries. One method is to tie a piece of string onto a wooden strip that is longer than the hole is wide. Make a hole in the center of the drywall patch. Put the piece of wood into the hole in the wall and pull it flush against the back edges of the hole. Then, run the string from the piece of wood through the hole in the center of the drywall patch, and push the patch firmly against the wooden backing. You can put some weight on the string to hold the wood firmly against the inside of the wall and use mesh tape and patching compound to fasten the patch in place. Once the first coat has dried, cut the string holding the wooden strip - it will fall down and can remain in the wall. Now, you can continue to repair around the patch, and treat the hole the string ran through like a small nail hole.
The most important thing when patching drywall is to take your time. Work slowly, feather the edges, allow the compound to dry between layers, and you'll up with a wall that a pro would be proud to call his own.