It is sometimes impossible to cleanly remove broken studs and bolts, especially if they're rusty, but these tapered, fluted, hardened steel extractors offer you a good chance without damaging the female thread.
Drill a hole in the stud as accurately and centrally as possible at the size and depth recommended on the packaging, lightly tap in the extractor and turn it anticlockwise.
Applying heat from a gas torch will always help.
SCREW AND STUD EXTRACTOR SET #EXTRACT5