Heart failure is a leading cause of morbidity and mortality worldwide, and early prediction of outcomes is critical for timely intervention and improved patient care. Accurate prediction models can help clinicians identify high-risk patients, optimize treatment strategies, and reduce healthcare costs. In this study, we developed and evaluated machine learning models to predict mortality in patients with heart failure using a medical dataset of 299 patients with 13 clinical variables collected in 2015. Four models were tested, including a Feedforward Neural Network (FNN), Random Forest, XGBoost, and an ensemble model combining all three models. The experimental process included data preprocessing, feature scaling, and stratified cross-validation to ensure robust evaluation. The results showed that the ensemble model achieved the best performance with an ROC-AUC of 0.9134 and an F1 score of 0.7439, outperforming individual models such as Random Forest (ROC-AUC: 0.9117) and XGBoost (ROC-AUC: 0.9130). FNN, despite having the highest accuracy (0.8455), showed lower performance in terms of recall and precision, likely due to its sensitivity to overfitting on small datasets. These results highlight the effectiveness of ensemble learning in medical prediction tasks, especially for handling complex, high-dimensional health data. The proposed ensemble model has the potential to be integrated into clinical decision support systems, enabling real-time risk assessment and personalized treatment plans for heart failure patients. Future research should explore larger, multicenter datasets, incorporate advanced feature engineering techniques, and investigate the integration of deep learning architectures such as convolutional neural networks (CNNs) or recurrent neural networks (RNNs) to process sequential data such as ECG signals.