Certified GKH Gardening Expert
I see from the photo, that the soil is too moist. This has likely caused an infection, and it may be beyond repair at this point.
Cactus care requires a light mix made for cacti, that is fast draining. They like to be thoroughly dry between waterings in the future.
This collection of articles will give you more information on cactus care: https://www.gardeningknowhow.com/ornamental/cacti-succulents/scgen/