Doctors can determine whether you have had a heart attack through tests like an electrocardiogram (ECG or EKG) or echocardiogram.