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 setting 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 the 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 the 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 consists of trimming the edges or even modifying the shape of the opening with a sharp knife or keyhole saw. You can then cut a piece of drywall approximately the same size and shape as the hole (just a little smaller). Next, cut a narrow piece of wood 4 or more inches longer than the longest dimension of the hole. Insert the piece of wood inside the wall and center it in place. Adding a screw centered on the stick will provide you with a "handle" to hold and move the stick in the right position. Once centered, screw it to the drywall with a screw at each extremity. With this inside support piece, you are now ready to insert the patch into the hole and screw it in place into the stick of wood for stability. Complete the task by covering the joint with drywall tape and covering the patch with a joint compound.
A similar concept if you're going for supplies at the hardware store, is to buy the specially designed Drywall repair clips which have a plate that goes inserted inside the wall and are temporarily held into place around the edges of the hole by 2 tabs bent to wrap around the outside of the drywall surface, until you can secure with a screw through the drywall. Proceed as previously described to finish. You will come across different systems as such with names like wall repair kit or wall repair patch, that are as good, but all of them are designed to provide a solid backing for the patch. 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 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.