Heart failure is a global health problem that not only causes physical problems, other impacts such as psychological, social, and economic, as well as depression, which affects treatment, worsens functional status, and increases hospitalization rates to death. According to the World Health Organization (WHO), nearly 17.5 million people die from cardiovascular disease, which represents 31% of deaths in the world. Using machine learning to predict the survival of patients with heart failure so that they can take precautions from the start. The stages of the research carried out include the business understanding stage, the data understanding stage, the data preparation stage, the modeling stage, and the evaluation stage. In this study, using feature selection using best-first resulted in 4 very influential features, namely age, injection_fraction, serum_creatinene and time, and handling imbalance class using the class balancer model. Random forest algorithm with 80% percentage split method which produces 91.45% accuracy, mean absolute error 0.1874, incorrectly classified instances 8.55%, precision 0.915, recall 0.914, AUC 0.953.