The synthesis of methanol from CO2 hydrogenation is an effective measure to deal with global climate change and an important route for the chemical fixation of CO2. In this work, carbon-confined MoSe2 (MoSe2@C) catalysts were prepared by in situ pyrolysis using glucose as a carbon source. The physico-chemical properties and catalytic performance of CO2 hydrogenation to yield methanol were compared with MoSe2 and MoSe2/C. The results of the structure characterization showed MoSe2 displayed few layers and a small particle size. Owing to the synergistic effect of the Mo2C-MoSe2 heterojunction and in situ carbon doping, MoSe2@C with a suitable C/Mo mole ratio in the precursor showed excellent catalytic performance in the synthesis of methanol from CO2 hydrogenation. Under the optimal catalyst MoSe2@C-55, the selectivity of methanol reached 93.7% at a 9.7% conversion of CO2 under optimized reaction conditions, and its catalytic performance was maintained without deactivation during a continuous reaction of 100 h. In situ diffuse infrared Fourier transform spectroscopy studies suggested that formate and CO were the key intermediates in CO2 hydrogenation to methanol.