The plant may have been weakened for two possible reasons. One being a poor genetic constitution and the other may be insufficient lighting. I suspect the latter may have contributed, since you have put your cactus on the windowsill. Is this plant variegated or did it become paler after the onset of infestation?
Unfortunately, Opuntias (and the Opuntioid ...
These could be tiny bugs called scale insects (Hemiptera).
More information here: https://www.missouribotanicalgarden.org/gardens-gardening/your-garden/help-for-the-home-gardener/advice-tips-resources/pests-and-problems/insects/mealybugs/insect-pests-of-cacti-and-succulents.aspx