There are two different types of procedures for ulcerative colitis. Both surgeries remove the colon and rectum. Once those parts are gone, so are the pain, inflammation, and constant urges to go to the bathroom that happen during a flare. You'll still need to go often, but less than before.
In one operation, the surgeon uses the end of your small bowel to create a pouch connected to your anus on the inside of your body. (You would temporarily need to wear a bag outside your body over the hole that your surgeon makes, until your body heals from the surgery and is ready for the internal pouch.)
In the other procedure, the surgeon creates a small opening in the abdomen to collect waste in a removable pouch on the outside of the body.
Your doctor can let you know if either operation would help you.