With the continuous exploration and development of oil wells, we must pay attention to the risk of leakage from abandoned wells. Therefore, it is necessary to plug and abandon the abandoned well. However, there are many limitations in the traditional plugging and abandonment (P&A) operation, for example, cement's bearing capacity, the cement's corrosion resistance, the problem of the extended operation time, and high cost. To overcome the aforementioned issues, a thermite plugging and abandonment (TP&A) technology is proposed in this field. The technology uses the aluminothermic reaction to melt the original or set materials for P&A operation. To promote the phase transformation of more materials in the well to form a plug with good plugging performance, the temperature distribution in the TP&A system was optimized. Based on the heat conduction theory and successive overrelaxation iterative method, a heat conduction model based on the temperature release law of aluminothermic reaction is established and solved. The temperature change law under different combinations of the downhole environment is studied. The optimized model can maintain the high-efficiency transfer of energy, fluid–structure interaction, and the interaction between fluids. The material after the phase change can be cooled to form a plug with good plugging performance.