Colorectal surgery can be performed under general anesthesia, which involves putting the patient to sleep, or under regional anesthesia, which involves numbing the area around the surgical site.