If it looks a bit soggy, and has rotting spots on it you are probably witnessing a cactus dying. They tend to hate being overwatered and this is the easiest way to kill them. On very rare occasions, underwatering a cactus can cause it to give up as well. If the soil is dry, and it looks half dead, then probably that is why. Give it a little water. If the soil is very wet, and it looks half dead - remove if from the soil, let its roots dry out for a day or two, and put it in some decent well drained soil. Do not overwater it again. Buy a water meter, and give it just enough water to be "moist" and then allow it to dry out and water again in two to three weeks. These things survive in deserts that get a few inches of rain every few years - do not spoil your cacti with too much water. They just hate it.