Echocardiography uses ultrasound waves to image the heart and vessels. Ultrasound transducers contain piezoelectric crystals that generate ultrasound waves when voltage is applied, and receive returning ultrasound waves to form images. Optimal echocardiograms are obtained by adjusting settings like frequency, power, frame rate, depth, focus, zoom, gain, and time gain compensation to account for tissue properties and obtain clear images of cardiac structures and function.