I am trying to replace old 2" steel shower drain pipe with copper or pvc pipe, and in order to do that I cut the old elbow out and now I am struggling trying to remove the rest of the old steel 2" pipe. I simply have no idea how to get this pipe out.

It feels loose and I am able to turn it a little bit and move it around but I am unable to remove it from its joint. I have no idea on what the proper procedure is for removing this pipe. Any idea for how to remove this pipe would be greatly appreciated.

Also, once I remove the old pipe, what material should I use to replace it? Should I use pvc, abs, or copper? I would mostly prefer something that will last for a very long time.

Thank you in advance.