During a Pap smear, a healthcare provider uses a speculum to open the vaginal canal and a small brush to collect cells from the cervix. The collected cells are then examined under a microscope for abnormalities. In the case of HPV testing, the same cell sample can be used to detect the presence of high-risk HPV DNA.