An Electrocardiogram (EKG) functions by detecting and recording the electrical signals generated by the heart each time it beats. During the test, small sensor patches known as electrodes are strategically placed on the patient's chest, arms, and legs. These electrodes are connected to an EKG machine by lead wires. When the heart beats, it produces electrical impulses that travel through the heart muscle, triggering it to contract and pump blood. The EKG machine captures these impulses and translates them into graphical lines displayed on a monitor or printed on paper. This graphical representation allows healthcare providers to analyze the heart’s rhythm, speed, and regularity, thereby facilitating the diagnosis of various heart conditions, such as arrhythmias, heart attacks, and more.