Among gynecological cancers, cervical cancer is a common malignancy and remains the leading cause of cancer-related death for women. However, the exact molecular pathogenesis of cervical cancer is not known. Hence, understanding the molecular mechanisms underlying cervical cancer pathogenesis will aid in the development of effective treatment modalities. In this research, we attempted to discern candidate biomarkers for cervical cancer by using multiple bioinformatics approaches. First, we performed differential expression analysis based on cervical squamous cell carcinoma and endocervical adenocarcinoma data from The Cancer Genome Atlas database, then used differentially expressed genes for weighted gene co-expression network construction to find the most relevant gene module for cervical cancer. Next, the Gene Ontology and Kyoto Encyclopedia of Genes and Genomes enrichment analyses were performed on the module genes, followed by using protein–protein interaction network analysis and Cytoscape to find the key gene. Finally, we validated the key gene by using multiple online sites and experimental methods. Through weighted gene co-expression network analysis, we found the turquoise module was the highest correlated module with cervical cancer diagnosis. The biological process of the module genes focused on cell proliferation, cell adhesion, and protein binding processes, while the Kyoto Encyclopedia of Genes and Genomes pathway of the module significantly enriched pathways related to cancer and cell circle. Among the module genes, SOX9 was identified as the hub gene, and its expression was associated with cervical cancer prognosis. We found the expression of SOX9 correlates with cancer-associated fibroblast immune infiltration in immune cells by Timer2.0. Furthermore, cancer-associated fibroblast infiltration is linked to cervical cancer patients’ prognosis. Compared to those in normal adjacent, immunohistochemical and real-time quantitative polymerase chain reaction (qPCR) showed that the protein and mRNA expression of SOX9 in cervical cancer were higher. Therefore, the SOX9 gene acts as an oncogene in cervical cancer, interactive with immune infiltration of cancer-associated fibroblasts, thereby affecting the prognosis of patients with cervical cancer.