Answer: It sounds as though you're overwatering your yucca. Overwatering will show up as foliage collapse or cane rotting, especially at the soil line. I'd cut away the the black and squishy parts and then adjust the watering, allowing the top inch or two of soil to dry out before watering throughly. The insects are a secondary problem and may have shown up because your yucca is under stress. You can use an insecticide such as Neem Oil on your plant to control the insects.
Best wishes with your yucca!
Q&A Library Searching Tips