A pacemaker is a small device implanted under the skin near the collarbone to regulate the heart's rhythm. It involves placing a generator and leads (wires) into the heart via veins. The pacemaker sends electrical impulses to maintain normal heartbeats. This procedure is typically outpatient but may require an overnight stay for observation.