That’s not a proper cactus – some kind of succulent. And not too well looked after either…
You’ll need free draining soil/peat – with a higher than usual (flor plants) percentage of gravel – B and Q do a nice specialist range in small bags that makes it easy. Do pot it on after removing the dead spurs/leaves to a pot about an inch or so bigger.
Water 2x a week a little more when it’s hot. October to March really reduce the watering so that the soil stays slightly damp and nothing more. For your first time sit it in a saucer of water to give it a good drink after potting on.
In spring give it 1/4 strength (ie a 1/4 of what they recommend) tomato feed every week, in summer every other week. None in autumn or winter.