Corydalis yanhusuo W. T. Wang, a traditional Chinese herbal medicine, has been used as an analgesic for thousands of years and it also promotes blood circulation. In this study, 33 Corydalis yanhusuo alkaloid active components were acquired from Traditional Chinese Medicine Database and Analysis Platform (TCMSP). A total of 543 pain-related targets, 1774 arrhythmia targets, and 642 potential targets of these active components were obtained using Swiss Target Prediction, GeneCards, Open Target Platform, and Therapeutic Target Database. Fifty intersecting targets were visualized through a Venn diagram, KEGG and GO pathway enrichment analysis. The analysis proposed that sodium ion channels are likely potential targets of Corydalis yanhusuo active components as analgesia and anti-arrhythmia agents. Molecular docking showed that the 33 components could bind to Nav1.7 and Nav1.5 (two subtypes of ion channel proteins) with different binding energies. In a patch clamp study, dihydrosanguinarine and dihydrochelerythrine, two monomers with the strongest binding effects, could inhibit the peak currents and promote both activation and inactivation phases of Nav1.5. Meanwhile, dihydrosanguinarine and dihydrochelerythrine could also inhibit peak currents and promote the activation phase of Nav1.7. Therefore, the findings from this study provide valuable information for future uses of traditional Chinese medicines to treat pain and cardiovascular disease.