Cardiac disease is a chronic condition that impairs the heart's functionality. It includes conditions such as coronary artery disease, heart failure, arrhythmias, and valvular heart disease. These conditions can lead to serious complications and even be life-threatening if not detected and managed in time. Researchers have utilized Machine Learning (ML) and Deep Learning (DL) to identify heart abnormalities swiftly and consistently. Various approaches have been applied to predict and treat heart disease utilizing ML and DL. This paper proposes a Machine and Deep Learning-based Stacked Model (MDLSM) to predict heart disease accurately. ML approaches such as eXtreme Gradient Boosting (XGB), Random Forest (RF), Naive Bayes (NB), Decision Tree (DT), and K-Nearest Neighbor (KNN), along with two DL models: Deep Neural Network (DNN) and Fine Tuned Deep Neural Network (FT-DNN) are used to detect heart disease. These models rely on electronic medical data that increases the likelihood of correctly identifying and diagnosing heart disease. Well-known evaluation measures (i.e., accuracy, precision, recall, F1-score, confusion matrix, and area under the Receiver Operating Characteristic (ROC) curve) are employed to check the efficacy of the proposed approach. Results reveal that the MDLSM achieves 94.14% prediction accuracy, which is 8.30% better than the results from the baseline experiments recommending our proposed approach for identifying and diagnosing heart disease.