In this paper, the mathematical model of the electrical and thermal processes proceeding during the electrosurgical polypectomy is considered. During a colonoscopy, the endoscopist can remove abnormal growths (polyps) inside the large intestine (the colon). In the electrosurgical polypectomy procedure, a polypectomy snare is tightened around the base of the polyp. Next, the electric current flows for a short moment of time from the snare loop (the first electrode), through the polyp-colon tissues and the other body tissues, to the second electrode placed on the patient's skin. Both electrodes are connected to the electrosurgical generator unit. This medical surgery allows to cut off the polyp stalk from the colon wall. The systems of the partial differential equations that describe the thermal and electrical processes with the appropriate initial-boundary conditions are proposed. The examples of numerical simulations related to two duty cycles of the electrosurgical generator unit are presented. Simulation results can be helpful for the surgeons to choose the optimal heating time and to set other parameters of the electric current that flows by tissues during the endoscopy procedure.