Repairing and Patching
Small nail holes or shallow dents can be repaired pretty easily with a little bit of patching compound and a putty or taping knife. Then let the compound dry, sand over it, then prime and paint.
Nails will sometimes pop through the surface if they are not holding properly. To fix this, first resink the nail into the drywall. Then drive a new screw in next to the nail to hold the drywall into the framing. Apply compound over both fastener heads. When they dry, you can sand and prime over them.
Patching Larger Holes
Larger holes in drywall are difficult to patch because there's no backing material behind them.
There are a few ways to build new backing. One way is to take a piece of cardboard, slightly larger than the hole, and tie a string through the middle of it.
Insert the cardboard into the hole and pull the string tight. Then while holding it tight, apply a first coat of patching compound to fill the hole.
Once it's dry, cut the string and apply a second coat. To help strengthen the patch you can apply some fiberglass tape to the seams and then tape over that. Feather out the compound around the hole with a wide knife. Let it dry and sand it smooth.
You could also use plywood strips as the backer, cutting them longer than the hole, but narrow enough to go through the hole. Secure them by screwing into them through the drywall and use enough to provide backing for the entire hole.
Then finish the patch as described above.
Another method is called the "hat patch." For this you cut a piece of drywall the size of the hole, but leave the paper on front run an inch or two longer. The paper will serve as the joint tape.
Insert the "hat" into the hole with some joint tape around the drywall. Cover the patch with two coats of joint compound. Then sand it and prime over it.