They should get some fresh plant matter each day in addition to their normal dried food. Fish pellets are high in protein and worth feeding a few times each week.
The crab might have been pulled out of its shell by another crab or it could have an infection.
Does the crab get any natural sunlight?
In the wild they spend all day outside in the sun. In captivity they can suffer from vitamin D deficiency that can lead to health issues. You can put them outdoors in the early morning or afternoon and let them crawl about. Don't leave them in the sun for too long if they are not use to it because they can get sunburnt and over heat. But 10 minutes in the morning or afternoon will be a good start and you can gradually increase the time they get sunlight.
Don't leave them out during the middle of the day if it's hot because they can cook.
Keep the enclosure clean and warm and vary the diet and they usually do well.