Neocosmospora solani causes Fusarium wilt disease and root rot, which are serious problems worldwide. To determine the growth inhibition of Neocosmospora solani by Trichoderma hamatum volatile organic compounds (VOCs), the major chemical components of Trichoderma hamatum VOCs and the differences in their contents at different times were analysed, and the activity of these components was evaluated. The antifungal activity of Trichoderma hamatum was measured by a screening test, as Trichoderma hamatum exhibited strong antagonism against Neocosmospora solani in vitro. The double plate technique was used to verify the activity of Trichoderma hamatum VOCs, and the inhibition rate was 63.77%. Neocosmospora solani mycelia were uneven and expanded, the contents of the cells leaked, and the mycelia shrank and presented a diaphragm in the hyphae upon Trichoderma hamatum VOCs treatment. Trichoderma hamatum VOCs and their contents at different times were analysed by using GC–MS. 6-Pentyl-2H-pyran-2-one clearly presented in greater amounts than the other components on Day 3, 4, 5, and 6. VOCs from Trichoderma hamatum exhibited evident effects on the percentage of healthy fruit after Day 3. Moreover, Trichoderma hamatum can improve the biological control of diseases caused by soilborne pathogens, and can be applied in biocontrol fields.