Get rid of the shriveled piece in the top picture. Unfortunately, once you start you will have to cut out all rot. Cactus have a funny way of looking fine from the outside and rotting to nothing on the inside. You don't know it until it either starts to "deflate" or it falls over and breaks.
In the bottom picture. Cut off the bottom of the broken piece until there is no more rot. If the rot goes all the way to the top, toss it. If you do wind up with a section with no rot, let it dry in the shade for a week, then pot it in dry soil. Depending on how things go, you may be able to start watering in two weeks. Water sparingly until the roots are established.
If this were my plant I would remove it from the pot to see what is going on with the roots. I wouldn't be surprised if the roots were rotten. You'll have to cut away anything that looks rotten. Then dust with sulphur (agricultural sulphur, in the US you can find it in a big box store in the plant section)
It also looks like you've got mealy bugs or (hopefully) just floaty pearlite. If the white things move, kill them all! Mealy bugs are difficult to get rid of. I use systemic insecticide with Imidicloprid. In the US there is a Bayer product that uses this substance. Oh, and segregate any plants affected from non-affected plants.
Good luck, I wish I had better news!