There are two ways to get an echocardiogram. The simplest and least invasive is essentially an ultrasound, like the one they use to check on unborn babies in their mother's womb.
It is painless. The other one is a transesophageal echocardiogram, which involves putting the device down through your mouth and throat into the esophagus. It has the advantage of seeing better, but more invasive.