 For that, you can kind of just simply tap it in and then drive a new nail right next to it. But you have to make sure that you cover the head of the old nail with the head of the new one. Then you can spackle that area, smooth it, and allow it to dry really well. Then go ahead and sand and touch up that area. Now, you can also use a drywall screw instead of a nail. I mean, that way it's just never going to back out.