Due to the significant concentration of heavy metals in the contaminated area, it presents an imminent threat to both living organisms and the environment. In this research, we concentrate on finding an effective solution for eliminating Cd(II) and U(VI) from water. Our approach involves utilizing MgFe-layered double hydroxide (LDH) nanosheets combined with graphitic carbon nitride (GCN) nanosheets to ensure the effective elimination of these hazardous metal ions. The characterization techniques, including SEM, XPS, XRD, and BET analysis, confirmed the hierarchical layered structure of GCN/MgFe LDH with a significant surface area of 127.91 m2/g. Batch investigations demonstrated that the pH of the solution influences the elimination of both metal ions, while kinetics and equilibrium data well align with a pseudo-second-order model and the Langmuir model (R2 = 0.996–1.0), respectively. GCN/MgFe LDH demonstrated impressive removal capacities of 312.30 mg/g and 273.42 mg/g for Cd(II) and U(VI) respectively. A thermodynamic analysis indicated that the adsorption process of both metal ions was endothermic and spontaneous. Furthermore, the GCN/MgFe LDH can be reused for over five cycles. In the fourth cycle, it maintained a removal percentage of over 95 % for both metal ions when 0.1 M HNO3 was used for desorption. In continuous column tests, the GCN/MgFe LDH reduced metal ion concentrations to levels below USEPA standards (<0.005 mg/L and 0.003 mg/L for Cd(II) and U(VI), respectively) for up to 4000 bed volumes, demonstrating its potential for wastewater treatment.