A pacemaker is a small medical device implanted in the chest to help regulate heartbeats. It sends electrical signals to the heart to ensure it beats at a normal rate, especially in cases of arrhythmias or irregular heartbeats. Pacemakers can be temporary or permanent, depending on the patient's condition, and are typically used to treat bradycardia (slow heart rate) or other heart rhythm disorders.