Purpose. To improve immunotherapy efficacy for melanoma, a coexpression network and key genes of M2 macrophages in melanoma were explored. A prognostic risk assessment model was established for M2-related coexpressed genes, and the role of M2 macrophages in the immune microenvironment of melanoma was elucidated. Method. We obtained mRNA data from melanoma and peritumor tissue samples from The Cancer Genome Atlas-skin cutaneous melanoma (TCGA-SKCM). Then, we used CIBERSORT to calculate the proportion of M2 macrophage cells. A coexpression module most related to M2 macrophages in TCGA-SKCM was determined by analyzing the weighted gene coexpression network, and a coexpression network was established. After survival analysis, factors with significant results were incorporated into a Cox regression analysis to establish a model. The model’s essential genes were analyzed using functional enrichment, GSEA, and subgroup and total carcinoma. Finally, external datasets GSE65904 and GSE78220 were used to verify the prognostic risk model. Results. The yellow-green module was the coexpression module most related to M2 macrophages in TCGA-SKCM; NOTCH3, DBN1, KDELC2, and STAB1 were identified as the essential genes that promoted the infiltration of M2 macrophages in melanoma. These genes are concentrated in antigen treatment and presentation, chemokine, cytokine, the T cell receptor pathway, and the IFN-γ pathway. These factors were analyzed for survival, and factors with significant results were included in a Cox regression analysis. According to the methods, a model related to M2-TAM coexpressed gene was established, and the formula was
risk
score
=
0.25
∗
NOTCH
3
+
0.008
∗
DBN
1
−
0.031
∗
KDELC
2
−
0.032
∗
STAB
1
. The new model was used to perform subgroup evaluation and external queue validation. The results showed good prognostic ability. Conclusion. We proposed a Cox proportional hazards regression model associated with coexpression genes of melanoma M2 macrophages that may provide a measurement method for generating prognosis scores in patients with melanoma. Four genes coexpressed with M2 macrophages were associated with high levels of infiltration of M2 macrophages. Our findings may provide significant candidate biomarkers for the treatment and monitoring of melanoma.