The likelihood of car accidents increases during extreme weather conditions, such as fog, winds, snow, rain, etc. While it may not be possible to prevent all such accidents, their incidence can be reduced by taking proper measures. Therefore, an intelligent accident-avoidance system is necessary to predict the severity of accidents based on weather and road conditions. This research paper suggests three machine learning (ML) methods for an Internet of Things (IoT)-based accident severity prediction system. The methods are Random Forest, LightGBM, and XGBoost.The aim is to predict the severity of car accidents based on various weather features using a machine learning model. However, considering the previous work, we observed that the size of datasets is frequently minimal, and some of the research discusses the influence of the weather on the number of accidents. Therefore, we used the Countrywide Traffic Accident Dataset, which covers 2.8 million vehicle accidents in the United States from 2016 to 2021. In conclusion, our methodology appears to be efficient in predicting the severity of car accidents. Among the three methods, LightGBM achieved the highest prediction accuracy (72%), precision (70%), recall (70%), F1-scores (70%), and area curve (AUC) (0.86) of the receiver operating characteristic (ROC) curve.