Utilizing random forest algorithms to predict cardiac illness and evaluating their performance in comparison to that of logistic regression will be the major focus of this research project. In the course of the investigation, the random forest and the logistic regression methodologies are both taken into account. Two groups are statistically evaluated since the pretest power was 80% and the size of the sample was 20 for each group. According to the results of the experiment, a logistic regression model has an accuracy of 80% in predicting heart disease, whereas a random forest classifier has a mean accuracy of 87.64% in making the same prediction. It is possible to demonstrate, via the use of T-tests on independent samples, that there is a statistically significant difference between the two algorithms' levels of accuracy (p<0.05). This research investigated the efficiency and precision of several methods for predicting heart illness in order to improve the accuracy of heart disease prediction by using machine learning classifiers. The outcomes of the comparison show that the random forest strategy performs much better than the logistic regression methodology by a significant margin.