The most important immediate action is to empty any standing water from the pot. Either your pot doesn't have good drainage, or you're watering your plant too much.
If you notice blackened tips on the roots, this is the beginning of root rot. Gently rinse the plant’s roots. With a clean, sharp tool, remove ruined roots, allow to dry for 24 hours then treat with an anti-fungal agent.
Once you have treated the roots and removed any damaged tissue, it is time to re-pot the plant. Choose a container with proper drainage and use a pre-mixed cactus potting mix.
Allow the soil to dry completely is when the plant is in bloom. During the blooming season, provide more water and keep the soil moist, but not soggy. For every second watering, use a balanced fertilizer as well.