Addressing the urgent need for efficient CO2 reduction, a novel Co@C catalyst was synthesized through the pyrolysis of a unique layered metal–organic framework (MOF), featuring tunable thickness, pore sizes. The CO2 hydrogenation performance demonstrates an enhancement by an optimized structure that significantly improves stability, maintaining a 25% CO2 conversion rate over an extended 80-hour period. The catalyst's composite structure exhibits a dual-confinement effect, where the Co-C interface and graphitic carbon belt stabilize Co nanoparticles, preventing sintering during reaction cycles. This study delves into the structural modifications necessary for catalytic optimization in CO2 hydrogenation, offering valuable insights for designing efficient catalysts for CO2 reduction and advancing sustainable energy solutions.