An electrocardiogram (ECG) records the electrical activity of the heart. Electrodes placed on the skin detect small electric currents from the heart and transmit them to an amplifier. The amplified currents are recorded as wavy lines on paper or displayed on a screen. A normal ECG shows three recognizable waves - P, QRS, and T - which represent atrial depolarization, ventricular depolarization, and ventricular repolarization, respectively. The ECG provides information about the heart's rate, rhythm, and any damage or abnormalities. It is used to diagnose heart conditions like heart attacks, arrhythmias, and effects of diseases.