Molecular dynamics (MD) simulations are carried out to study the friction behavior of diamondlike carbon (DLC) films. The friction with hydrogen-free diamond film shows huge coefficient of friction (>1). The function of hydrogen is also investigated. Hydrogen atoms act as the isolating layer between the carbon films which makes the van der Waals interaction dominating. There's no carbon-carbon bonds formation or rupture between the two surfaces, and the friction coefficient drops to a large extent. The results agree well with experimental ones. The work provides ideas achieve near-zero friction.