When the head twists off a screw that’s been driven in place, you have a bigger problem. If you can leave the broken screw in place, as when securing a deck board, simply drill a pilot hole and drive a second screw about 1/4" from the first one.
Things get trickier when the screw location can’t be moved by even 1/4-in., such as when you’re installing a hinge. That’s when you need to go in after the broken piece and patch any damage you create. Your luck will fall into one of three categories: good, could be worse, and why me. “Good” happens when the head snaps off while some of the screw shank still extends past the wood surface. Grasp the screw shank with locking pliers and slowly turn it counterclockwise until it’s free.
“Could be worse” describes your situation when the screw breaks at the wood surface. Use the tip of a utility knife with a sharp blade to cut away just enough wood around the shank for the locking pliers to gain a firm grip and back out the screw. Then drill a 1/2-in. diameter hole centered on the screw hole. Fill that hole with a dowel (if the wood won’t show) or, for a seamless match, a wood plug cut from matching stock. If appearance matters and the screw is longer than 1 in., use a dowel capped with a plug to give the replacement screw plenty of material to grip.
Why me? That may be your first thought if the screw breaks off more than 1/8 in. below the surface. That’s the time to think carefully about how much you need that fastener in that location. If the answer is “definitely,” use your 1/2-in. bit to drill just down to the broken end of the screw. Use the point of a nail and light taps with a hammer to make five or six starter holes around the screw.
Then use a 3/32-in. or 7/64-in. drill bit to bore holes immediately beside the broken screw on all sides. (Drill at least as deep as the screw length.) Use an awl or nail set to wiggle the screw loose enough to grip with needle-nose pliers and pull free. Now you’re free to clean up the ragged holes with a 1/2-in. drill bit and fill it with a dowel or plug (or both if the screw is long). See, that wasn’t so bad.