The experimental development of calcium carbide slag foam is a multifunctional three-phase gel foam, which realizes the prevention and control of coal fire disasters in quarry areas by using the high water content, asphyxiation and sealing characteristics of the foam; the strong alkalinity of the foam can absorb acidic toxic and harmful gases such as CO2. In this experiment, the effects of three foaming agents sodium α-olefin sulfonate (AOS), sodium dodecyl sulfate (SDS), sodium aliphatic polyoxyethylene ether sulfate (AES) and their compounding on foam foaming properties were tested in a strong alkaline environment, and the optimal ratio of compounding was obtained; meanwhile, the effects of different foam stabilizers polyvinyl alcohol (PVA) and sodium alginate (SA) on foam stabilization were studied; in addition, the effects of different water-cement ratios on foam performance were comprehensively analyzed. Finally, it was verified that the calcium carbide slag foam had a certain blocking effect on coal samples and an obvious absorption effect on CO2 by the comprehensive testing system of coal spontaneous combustion characteristics and X-ray diffraction experiment.