Under local anesthesia, the incision is opened, the
generator is detached from the leads and thrown away, a new
generator is attached, and the incision is then closed.
The replacement procedure is typically shorter and simpler than the original installation of the pacemaker. Once you are in the lab being prepped for the procedure, external pacing pads are placed...I wouldn't worry about your heart stopping.
Best of luck with your procedure!