A colostomy bag collects stool from the body through a surgically created opening in the abdomen called a stoma. It is used when the colon or rectum cannot function normally due to disease, injury, or blockage, and waste can no longer pass through the anus.