Prediction of a heart attack is very important since it is one of the leading causes of sudden death, especially in low-income countries. Although cardiologists use traditional clinical methods such as electrocardiography and blood tests for heart attack prediction, computer aided diagnosis systems that use machine learning methods are also in use for this task. In this study, we used machine learning and feature selection algorithms together. Our aim is to determine the best machine learning method and the best feature selection algorithm to predict heart attacks. For this purpose, many machine learning methods with optimum parameters and several feature selection methods were used and evaluated on the Statlog (Heart) dataset. According to the experimental results, the best machine learning algorithm is the support vector machine algorithm with the linear kernel, while the best feature selection algorithm is the reliefF method. This pair gave the highest accuracy value of 84.81%.