An ECG (Electrocardiogram) records the electrical activity of the heart to detect irregular heartbeats, heart disease, and other cardiac conditions. It is a quick and painless test that helps doctors assess heart health and prevent potential complications.