In order to study the etching mechanism of hydrogen and oxygen atoms on the graphite phase in CVD diamond coatings, molecular dynamics simulation on the etching process was performed using first-principle molecular simulation calculation method. The adsorption process of either atom on graphite phase and the reaction heat and energy barrier of etching reaction were analyzed. The results show that the adsorption energy of oxygen atoms on the surface of the graphite phase is stronger than that of hydrogen atoms. At the same time, the chemical reactivity of oxygen atoms is stronger than that of hydrogen atoms. It is more easier to form an electron transfer reaction with the surface of the graphite structure. It takes 2 steps to break the C—C bond on the graphite phase surface, while the oxygen atom requires only one step. It means that hydrogen atoms etching the graphite phase have higher reaction energy barrier and require more energy. The oxygen-containing gas source can effectively reduce the deposition temperature of the CVD diamond coating and improve its quality.