Diagnosis of a hernia typically involves a physical examination and medical history review by a healthcare professional. Imaging tests such as ultrasound or MRI may also be used to confirm the presence and location of a hernia.