The usual method is to use an "easy-out" or similar screw extractor. These come in different sizes, usually in a kit with a wrench of some kind. To use these, you drill into the middle of the broken fastener and screw the easy out into the hole in a counter-clockwise direction. The easy out gets wider as it screws into the fastener and the friction eventually causes the damaged fastener to rotate in the same direction (ie. counter-clockwise and out). It usually helps to apply a little penetrating oil to the broken fastener, particularly if it's seized or rusted in place (quite often the reason the head broke off in the first place). Sometimes the original thread will need to be repaired with a helicoil or time-sert once the original fastener is removed.
Obviously, it's important to keep the drill bit straight. This is sometimes easier said than done.