Electrocardiography (ECG) is a non-invasive diagnostic tool used to assess the electrical activity of the heart. It provides critical insights into the heart's rhythm and function, aiding in the diagnosis and management of various cardiac conditions.