The electrocatalytic carbon dioxide reduction reaction (CO2RR) to produce high-value-added products is considered an effective method for achieving carbon neutrality and mitigating greenhouse effects. However, due to the coexistence of competing hydrogen evolution reaction (HER) alongside CO2RR, the selectivity of catalysts still requires improvement. Moreover, the complex preparation methods and high cost of noble metal catalysts pose challenges. Therefore, it is crucial to find a catalyst that is easy to prepare, cost-effective in terms of raw materials, and exhibits high selectivity. In this study, chitosan was utilized as a carbon source for the catalyst, with nickel as the primary metal. Through gasification at 650°C and morphology control via formation of hollow structures using Cd metal particles, along with F doping modification, an electrocatalyst (NiCd650F0.2) was prepared. This catalyst exhibited the highest CO selectivity of 90.3 % at −1 V vs. RHE, with a CO partial current density of −10.68 mA·cm−2 at −1.2 V vs. RHE. Stability tests demonstrated that its selectivity and activity remained excellent over 8 hours. Density functional theory (DFT) calculations further indicated that F doping significantly lowers the adsorption energy barrier of reactions, promoting reaction kinetics and enhancing catalyst selectivity.