A pacemaker is a small medical device used to regulate or stimulate the heartbeat. It consists of a small unit implanted under the skin, and electrodes connected to the heart. The pacemaker sends electrical impulses to the heart to regulate the heartbeat.