The invention discloses an environmentally-friendly sterilizing and deodorizing air freshener. The air freshener comprises, by weight, 1-3 parts of mixed essential oil, 15-25 parts of plant extract, 10-20 parts of ethanol, 7-9 parts of sodium alkyl benzene sulfonate, 0.2-0.6 parts of an antiseptic, 0.2-0.4 parts of an antioxidant, 25-35 parts of carrageenan, 10-20 parts of agar, 6-12 parts of sodium alginate and 5-8 parts of a cellulose thickener. The air freshener can effectively remove some odorous substances in air and keep the indoor fragrance for a long time, also can effectively inhibit the activity of Escherichia coli and Staphylococcus aureus in the air, has broad spectrum antibacterial activity, and can completely improve the air quality and keep the indoor air fresh and clean; the freshener has the characteristics of good resistance to a high temperature, good oxidation resistance, long-time moisturizing, low volatility and long service life; and above raw materials have safe and reliable components, are beneficial for human bodies, are harmless, are easy to obtain and have low cost, the method is concise, and the air freshener and the method have high practical values and good application prospects.