If your yucca has outgrown you or you want to preserve a dying yucca, you can simply cut it off at any height, preferably in spring. The trunk will then sprout again quite reliably (if the roots have not been damaged by waterlogging!). You should coat the cut surface with a wound closure available in specialized trade.
You can easily re-root the cut part. Attention: Keep the substrate only slightly moist. If the substrate is too wet, the plant will rot instead of rooting. Rooting hormones (also available in specialized shops) accelerate the root formation and make it safer.
You can even cut out parts of the stem and let the bare pieces root (Attention: Do not plant upside down; what was on top has to stay on top and should be protected from fungi etc. with wound closure).