Immediatelly take it out, washe well with warm water and dry using a fan.
When it completely dried evaluate damage. Clip off all small roots involved
into decay, use sharp surgical spoon or something like that to remove all
yellowish/brown/soft/ tissue from root or plant. You need to do this very
accurately and until you reach absolutely clean tissue. If you think that
damage is too big to be repaired - craft lophophora on cereus pachanoi,
peruvianus, or trichocereus - depends of diameter of the plant.
Unfortunately, most often if you saw external signs of decay - the plant
already severely damaged.
All surfaces after surgery need to be powdered with sulfa powder and dry up
for several days till surface will get "glassy" texture and look.
Eugene