Many companies have collapsed in recent years due to the economic downturn and the COVID-19 epidemic, both of which have severely harmed them. A model of this kind can serve as an early warning system, alerting decision-makers to potential problems with their finances so they can take preventative action before their situation worsens. Forecasting Financially Distressed Businesses (FFDB) is the primary goal of this study. The most significant finding of this study is that Extreme Gradient Boosting (XGBoost) outperforms other popular machine learning models. To speed up the forecasting process, it was decided to utilize a method called Particle Swarm Optimization (PSO) to reduce the number of features used in the model. On the Polish, and Qualitative Bankruptcy Prediction Datasets, five models were tested and judged. In comparison to other learning models, the experimental findings showed that the PSO-FS-XGBoost model performed very well, with an accuracy rate of 100% and the best overall Area Under the Curve (AUC) of this framework reaching 100%. The feature selection in the PSO-FS-XGBoost model boosted accuracy by 4%, sped up the model by 3.74 times, and reduced the feature space by up to 30%.