A pacemaker is a small battery-operated device that's implanted in your chest, just below your collarbone. It's usually used to stop your heart beating too slowly, but in atrial fibrillation it may be used to help your heart beat regularly.