Poke the area around the anchor to test for stability. If the drywall is very loose or crumbly, you will need to remove the old anchor entirely and then repair the hole with joint compound. If the drywall is somewhat stable, you can fill the area around the hole with compound and try to continue to use the old anchor.
Fill the area with quick-setting joint compound. First, mix a batch of compound according to the manufacturer’s instructions (typically, combine a small amount of water with the powder and mix thoroughly). Then use a small putty knife to press it deep into the damaged area, leaving the repair site smooth and flush with the wall.
Allow the compound to dry fully, then apply a second coat. Drying times vary among brands, from several minutes to several hours. Check the packaging for the exact time.
Allow the second coat to dry fully, then smooth the area with 150-grit sandpaper.
Install a new anchor according to the manufacturer’s instructions (if necessary). Typically, you will need to drill a small hole with a specific-size drill bit, then push the anchor into the hole. Once it is flush with the wall surface, insert the anchor screw and use a screwdriver to turn it clockwise until it engages the expansion mechanism.
Test the anchor for stability before hanging a heavy object from it. If it is unstable, remove it completely, repair the area again and install a new anchor.