Depends. What it is broke off in. Sometimes you can use a hacksaw blade and cut through the male part just through the threads and then pry out the piece. I have sometimes had to make three cuts and take the pipe out in sections. If it is in another pipe and you can heat the end, this will loosen the pipe and an E Z out or extractor can be used to back out the piece. If it is a small pipe that is too small for a hacksaw blade, if you are very careful and lucky, you can drill out most of the pipe to the threads in the female part and then peal out the thread or rethread the female side which will clean out the threads.
With a extractor
There is a tool called easy out.
Traditionally, Iron Pipe Size, but can also mean that it has male pipe threads (threads on the outside of the pipe).
An inside pipe wrench also called a pipe extractor. It drives into the broken off pipe and is then turned with a crescent wrench.Normally a extractor or inside pipe wrench does not work removing a pipe . What works best is the use of a hack saw blade and a chisel to cave in the threads after the threads are cut.. BECAREFUL not to cut into the fitting threads
Only apply thread sealant to the MALE threads of the pipe.
NO you cannot heat as any flame can cause a severe explosion and the very least crack the CI fitting The threads have to be cut out gently and possibly re tapped
Compression uses a ferrule or brass ring around the pipe that is compressed by the nut into the pipe and against the fitting. There is no such thing as Female Pipe Threads. There are Male and Female fittings, the pipe is the Male side and the fitting is Female. The Male goes inside of the Female. They both have pipe threads. Pipe thread, Compression, and Flare all have different thread pattern so that they cannot be mixed. They all do different jobs.
Male Iron Pipe Adapter. This means it has male pipe threads and will adapt to either PVC pipe, Poly pipe or a few other types of pipe to make a transition from threaded pipe to something else.
Plumbing pipe threads are squared and conduit pipe threads are tapered.
Water pipe threads are tapered, electrical pipe is not tapered.
IPS- Iron Pipe Size (Threaded Pipe) Standard pipe threads. Female IPS is internal pipe threads, male IPS are external pipe threads. Also known as "NPT" or "NPS". CC- Copper Connection (Soldered, aka Sweat Connection)
Extractor.