Transesophageal echocardiography (TEE) is a diagnostic procedure that uses ultrasound waves to create detailed images of the heart by inserting a probe into the esophagus, providing clearer images than traditional transthoracic echocardiography. It is particularly useful for assessing heart structures and functions, detecting heart valve diseases, and identifying sources of embolism in patients with stroke or other cardiovascular conditions.