Diagnosis often begins with a thorough medical history and physical examination. For urinary tract infections, a urinalysis and urine culture can help identify the causative bacteria. For conditions like PID and endometriosis, imaging techniques such as ultrasound or laparoscopy may be necessary.