Yuccas need well-drained soil but will do well in soils with a low nutrient content. If the soil is very heavy or compacted and the yucca roots would have a hard time pushing through it, amend it with compost or plant it in a raised bed or even a mound of soil that's been dug up, loosened and amended. Sandy or gravelly soils will support yucca growth even in wet, humid climates because they provide excellent drainage.
Yuccas need full sun. A location in full sun is one that gets at least six hours of direct sunlight per day. According to the Arizona State University Extension, when planting yucca transplants, the original directional orientation shouldn't change; in other words, the side that was facing south before it was moved -- or purchased -- should continue to face south after it is planted. Keeping the orientation the same will cause the plant far less stress, as the side that's adapted to the strongest sunlight will be the same after it's transplanted. Yuccas have very sharp spines; consider this and their size at maturity when selecting your planting site.
When planting a yucca, plant the roots no deeper than they were planted in the nursery or in the ground where you dug it up. Planting deeper than that will impede gas exchange between the roots and the surface -- the roots will have difficulty breathing -- and water will collect around the base of the stem, which will lead to rot. Cover the new transplants with a light-colored shade cloth until they show signs of new growth, the University of Arizona Extension recommends.
Yucca is a low-maintenance plant. It doesn't need much water at all, doesn't need fertilizer and rarely needs any sort of pruning. The plant does put out suckers from its base, which can be removed and planted elsewhere. The plants will take about a year to establish themselves, so keep an eye on them and provide some early summer irrigation.