Wildfires are among the world's most pressing issues, and they are getting more prevalent as global warming and other environmental conditions deteriorate. These wildfires might be caused by humans or by natural causes. Wildfires are one of the factors contributing to the extinction of rare flora and wildlife that serve to maintain our planet's ecological balance. In this paper, a comparative analysis of various machine learning classifier models for predicting forest fires was undertaken using two separate datasets. The suggested system's processing is dependent on a few characteristics such as temperature, humidity, oxygen, and wind. Several machine learning classification techniques, including logistic regression, support vector classifier, decision tree, k neighbors and random forest, were used in this study. For further optimization of the model, K-fold cross validation method and hyperparameter tuning were implemented. The system reveals Support Vector Machine as the best strategy for the forest fire dataset, with 96.88% accuracy. Random Forest method was found to be the best for the Cortez and Morais dataset, with 90.24% accuracy.