Due to air pollution, pollutants that harm humans and other species, as well as the environment and natural resources, can be detected in the atmosphere. In real-world applications, the following impurities that are caused due to smog, nicotine, bacteria, yeast, biogas, and carbon dioxide occur uninterruptedly and give rise to unavoidable pollutants. Weather, transportation, and the combustion of fossil fuels are all factors that contribute to air pollution. Uncontrolled fire in parts of grasslands and unmanaged construction projects are two factors that contribute to air pollution. The challenge of assessing contaminated air is critical. Machine learning algorithms are used to forecast the surroundings if any pollution level exceeds the corresponding limit. As a result, in the proposed method air pollution levels are predicted using a machine learning technique where a computer-aided procedure is employed in the process of developing technological aspects to estimate harmful element levels with 99.99% accuracy. Some of the models used to enhance forecasts are Mean Square Error (MSE), Coefficient of Determination Error (CDE), and R Square Error (RSE).