The main thing now is to let the cactus dry out, but it's already too late to save the roots if they've been in water for two days and the stem has started to soften. Softening and semi-transparency - that's rot, and it's already starting to develop. You need to cut away everything that's affected down to healthy tissue with a sharp, clean knife or blade. Healthy cactus tissue should be firm and light-colored on the cut. Cut into the living part - a new plant can grow from that later.
After cutting, let the cuts sit in a dry place for 5-7 hours so they dry out and seal over. Then plant it in completely dry, loose cactus soil (or make your own from equal parts sand, perlite, and soil). The pot needs drainage, and for the first two weeks don't water it at all - just mist the air around it if it's really hot. Bright light but not direct sun, temperature above 20 degrees.
Even if the cactus looks rough after cutting, that's normal - the important thing is that the remaining part can develop roots and recover. Start watering only after a month, just a tiny bit, and only if the soil is completely dry. Cacti are very vulnerable to rot again during this period.