sometimes it is possible to gently push it back in with your hand and hope it heals up (extremists will stitch it back in but thats too expensive in my books), its risky, but the fish will die eventually due to complications otherwise. hopefully (and rarely) its just the reproductive organs (much higher recovery rate than bowels) if it is the bowels it is most likely caused by an intestinal blockage. STOP FEEDING IMMEDIATELY, add a prophylactic dose of medication if you want to prevent infection and lower the temperature a bit (this will help if there is a gas issue as well. Prolapsed rectum is most commonly caused by a diet too high in protein without enough roughage.