Turn off the water valve for the bath or shower, if it is still connected. The valve may be a tap or a lever; turn it clockwise as far as it will go.
Pull the the bath or shower out of place, using a pry bar if necessary, to expose the piping. Place the pry bar between the edge of the tub or shower and the wall, prying slowly and gently; move along the edge, inch by inch, separating the tub or shower from the wall. Pull out the wall, if necessary, to access the pipes. Gently push the pry bar into the wall, sticking it in an inch or less. Pry away the wall being careful not to pull at the pipes.
Cut the water pipes, when they become exposed, using the hacksaw. Cut them as close to the shut-off valve as you can reach. There is no need to close off the pipes, so long as the valve is shut off.
Cut the drainpipe using the hacksaw. The drainpipe in a basement bathroom will come up, out of the concrete floor; leave 3 inches of pipe above the ground so that you can attach a cap to the pipe.
Remove the bathtub or shower and the accompanying piping.
Measure the diameter of the drainpipe and select a pipe cap of the same material, designed for this diameter.
Spread a line of the cold weld compound on the inside edge of the cap.
Place the cap on the remaining pipe and push down firmly, securing the cap in place.