Oil and gas companies often encounter drilling failures across variable formations due to bit wear, pressure fluctuations, thermal effects. And formation instability. This study aims to design and train a machine learning model capable of forecasting critical drilling problems before they occur. By integrating drilling parameters with geological inputs, the model seeks to improve decision-making, enhance drilling efficiency, reduce non-productive time, and support safer well construction practices. A machine learning system was developed using key drilling and formation parameters such as hardness, bit wear, depth, pressure variations, thermal gradients, and recorded drilling incidents. Data preprocessing included normalization, feature extraction, outlier handling, and dimensionality reduction to identify the most influential risk features. Machine learning models, specifically Random Forest and Neural Networks, were trained and validated on separate datasets. Model performance was evaluated using RMSE, precisionrecall scores, and accuracy to determine reliability for real-time drilling support. The model achieved 87% accuracy. It predicted bit life within 12 hours of actual replacement time and estimated the rate of penetration with only a 0.8 m/hr error for wells between 1,000 and 5,000 meters. Pressure anomalies were detected with 89% precision and 85% recall, providing early warnings for kicks and blowouts. Predicted blowout risks closely matched actual values at multiple depths, and safe and risky zones were identified with high accuracy. High-pressure pockets matched field records, and thermal stress predictions differed by less than 5°C. This study shows that machine learning can accurately identify drilling risks in advance, helping improve safety, save time, and reduce overall drilling costs.