Hysteroscopy is primarily used to detect cancers of the endometrium, which is the lining of the uterus. It can also help identify uterine sarcomas and other abnormal growths that could potentially be malignant. Furthermore, it is used to investigate abnormal uterine bleeding, which can be an early sign of cancer.