I have rectal ulcer with rectal prolapse am taking pentasa (mesalamine) for 3 months but my doctor advise me to do pelvic floor exercises why? And how to do it?

Pelvic strengthen . You have rectal prolapse. Your doctor wants you to strengthen your supporting muscles so perhaps your prolapse will not recur. Ask your doctor for help and use your local library for pelvis exercise books. If it recurs you may need surgery. Try amazon books? Hope this helps.
Pelvic floor excerci. The pelvic floor exercise will help reducing the prolapse while Pentasa (mesalamine) helps with treating the ulcer.