Electrosurgery works by passing an electrical current through a specialized instrument to generate heat. This heat can either cut through tissue or coagulate blood vessels to prevent bleeding. The procedure is highly precise, allowing surgeons to target cancerous tissues while minimizing damage to surrounding healthy tissues. The instrument used can be a monopolar or bipolar device, each with its own specific applications and advantages.