This document discusses considerations for surgery in patients with implantable cardioverter-defibrillators (ICDs) or pacemakers. Electrocautery can cause electromagnetic interference that temporarily or permanently affects the device's functioning by resetting modes, inhibiting pacing, or triggering ICD shocks. The impact depends on factors like device type, lead placement, and whether the patient relies on pacing. Evaluation involves assessing the device and settings. Measures like using bipolar cautery, maximizing distance between devices and cautery, and magnet placement can reduce risks. After surgery, devices may need reprogramming and checking.