There are many questions about what to do for a cactus if it's not doing well. Some of the common problems are over watering, overwatering, and not enough light.
If you have a cactus that is not doing well, you may consider adding charcoal to the soil.