Remove loose drywall from around the damaged area by scraping it gently using a 4-inch drywall knife. Use a utility knife to cut off loose pieces that can not be scraped. The properly prepared area will have only solid drywall to which the joint compound can bond.
Scoop joint compound onto the edge of the drywall knife and smooth it into the damaged area. Use the drywall knife at a low angle to the surface to spread it and at more of an angle to scrape off excess. Fill in the damaged area so it is flush with the rest of the wall and as smooth as possible. Let the joint compound dry for 24 hours.
Sand the dried joint compound lightly using a drywall sanding sponge. Remove any bumps and ridges to make the surface smooth. Do not over-sand or you may remove too much joint compound.
Paint the repaired area using a paintbrush and paint that matches the rest of the wall.