The sugar supposedly reduces swelling by drawing out fluids from the prolapsed organ, and if it's not too bad, it may retract on it's own. The organ [ which can be rectal or, in a male, a hemipene ] then has to be kept moist until a vet can be seen. If you absolutely can't get to a vet, it must be very gently pushed back in. A beardie [ or any animal ] cannot survive if the rectal prolapse doesn't go back in.