Q.moon cactus
Got one and it turned brown from red. what did I do wrong?

A Moon Cactus is actually grafted onto the base of another cactus. This can make for a weakened cactus, making is susceptible to root rot.
If the stem has turned brown, it is generally root rot and likely cannot be saved.
Bacterial or fungal infections can also attack the cactus and cause it to turn brown.
In general if the plant has turned brown and is soft and mushy, it is best to discard it and start over.
Here is a link to refresh you on the care requirements.
https://www.gardeningknowhow.com/ornamental/cacti-succulents/moon-cactus/care-of-moon-cactus.htm