The invention discloses an illite meshy gel foamed mud fire prevention and extinguishing agent. The main points of the technical scheme are as below: the fire prevention and extinguishing agent comprises an illite composite flame retardant foaming agent, attapulgite clay powder with air purifying function, inorganic fiber spraying cotton, illite powder, gangue powder, expanded perlite powder, sodium alginate and water. The ingredients for the illite meshy gel foamed mud fire prevention and extinguishing agent are input into a plow harrow type feed mixer, and subjected to high-speed stirring to form the illite meshy gel foamed mud fire prevention and extinguishing agent. The meshy gel foamed mud is sprayed into a flaming coal seam by an inorganic fiber coating machine, so as to facilitate the formation of a holistic meshy gel foamed mud film in the fire prevention and extinguishing process, and the film always covers and adheres on the ledge surface, rapidly isolates the contact of burning coal seam with air, prevents burning of the coal mine, and avoids after-combustion of the coal seam, so as to achieve the goals of flame retardancy and fire prevention. The fire prevention and extinguishing agent is applicable to fire prevention and extinguishing in coal mine, mine operation area and forest.