Mark the south-facing side of the cactus with a piece of chalk if you are transplanting it. When you replant it, it will need to have the same orientation to prevent sun scald.
Insert a shovel into the soil 6 inches from the base of the cactus. Pull the shovel out and insert it into the soil again, cutting a circle around the cactus that is always 6 inches from the base.
Dig under the cactus, starting at your 6-inch cut. Cut through the roots with the edge of the shovel.
Wrap a garden hose around the middle of the cactus. Lift it out of the ground by the hose so you do not cut yourself on the spines.
Lay the cactus on its side. Examine the roots for any torn or damaged roots and cut them back to just above the tear.