A scheme for efficient terahertz generation in a GaAs sheet microcavity from the CO2 laser is presented, in which the process of difference frequency generation that considered cavity phase matching is derived theoretically. This model achieves its optimum working condition when the cavity length corresponds to a coherent length and the resonant condition of pump wave is satisfied. The results show that the efficiency can realize an effective improvement when the CO2 lasers pump wavelengths are 9.55 μm and 9.79 μm, respectively, with a peak power conversion efficiency of 2.04%, which corresponds to a photon conversion efficiency of 83%. This work is expected to provide a theoretical basis for relevant experiments involving doubly and even triply resonant structures.