We investigated the biocontrol mechanism of Bacillus cereus CF4-51 to find powerful microbes that effectively control Sclerotinia sclerotiorum. To assess its inhibitory effect on fungal growth, the plant pathogen (S. sclerotiorum) was co-cultured with Bacillus cereus. Scanning electron microscope (SEM) was used to study the morphology of S. sclerotiorum treated with CF4-51 biofumigant. The expression of sclerotium formation-related genes was analyzed by qRT-PCR. We performed whole genome sequencing of CF4-51 by PacBio Sequel platform. Lipopeptides were extracted from strain CF4-51 according to the method of hydrochloric acid precipitation and methanol dissolution. The volatiles CF4-51 were identified using gas chromatography–mass spectrometry (GC–MS). We found that the volatile organic compounds (VOCs) released by CF4-51 damaged the S. sclerotiorum hyphae and inhibited the formation of sclerotia. The qRT-PCR data revealed the down-regulated expression of the genes involved in sclerotial formation. Moreover, we analyzed the B. cereus CF4-51 genome and metabolites. The genome consisted of 5.35 Mb, with a GC content of 35.74%. An examination of the genome revealed the presence of several gene clusters for the biosynthesis of antibiotics, siderophores, and various other bioactive compounds, including those belonging to the NRPS-like, LAP, RIPP-like, NRPS, betalactone, CDPS, terpene, ladderane, ranthipeptide, and lanthipeptide (class II) categories. A gas chromatography–tandem mass spectrometry analysis identified 45 VOCs produced by strain CF4-51. Among these, technical grade formulations of five were chosen for further study: 2-Pentadecanone, 6,10,14-trimethyl-,1,2-Benzenedicarboxylic acid, bis(2-methylpropyl) ester, Dibutyl phthalate, Cyclododecane, Heptadecane. the five major constituents play important roles in the antifungal activity of the VOCs CF4-51 on the growth of S. sclerotiorum. The secondary metabolites produced by strain CF4-51are critical for the inhibition of S. sclerotiorum hyphal growth and sclerotial formation.