A pacemaker replaces the function of the natural pacemaker of the heart if a heart beats too slowly. It’s simply a miniature batter-powered device that sends out electrical impulses that cause the heart muscle to contract. Surgery is required to implant a permanent pacemaker, but can often be accomplished using local anesthesia.