Heart failure (HF) and kidney failure (KF) are closely related conditions that often coexist, posing a complex clinical challenge. Understanding the shared mechanisms between these two conditions is crucial for developing effective therapies. This study employed transcriptomic analysis to unveil molecular signatures and novel biomarkers for both HF and KF. A total of 2869 shared differentially expressed genes (DEGs) were identified in patients with HF and KF compared to healthy controls. Functional enrichment analysis was performed to explore the common mechanisms underlying these conditions. A protein-protein interaction (PPI) network was constructed, and machine learning algorithms, including Random Forest (RF), Support Vector Machine-Recursive Feature Elimination (SVM-RFE), and Least Absolute Shrinkage and Selection Operator (LASSO), were used to identify key signature genes. These genes were further analyzed using Gene Set Variation Analysis (GSVA) and Gene Set Enrichment Analysis (GSEA), with their diagnostic values validated in both training and validation sets. Molecular docking studies were conducted. Additionally, immune cell infiltration and correlation analyses were performed to assess the relationship between immune responses and the identified biomarkers. The functional enrichment analysis indicated that the common mechanisms are associated with cellular homeostasis, cell communication, cellular replication, inflammation, and extracellular matrix (ECM) production, with the PI3K-Akt signaling pathway being notably enriched. The PPI network revealed two key protein clusters related to the cell cycle and inflammation. CDK2 and CCND1 were identified as signature genes for both HF and KF. Their diagnostic value was validated in both training and validation sets. Additionally, docking studies with CDK2 and CCND1 were performed to evaluate potential drug candidates. Immune cell infiltration and correlation analyses highlighted the immune microenvironment, and that CDK2 and CCND1 are associated with immune responses in HF and KF. This study identifies CDK2 and CCND1 as novel biomarkers linking cell cycle regulation and inflammation in heart and kidney failure. These findings offer new insights into the molecular mechanisms of HF and KF and present potential targets for diagnosis and therapy.