Cloud computing enables access to various resources online, supporting services across numerous sectors. However, meeting real-time demands in IoT-based computing is challenging due to high latency issues. This is particularly problematic for low-latency applications, such as health monitoring and traffic surveillance, which require fast processing of large datasets. Performance drop occurs when data moves between central databases and cloud data centers. Edge and fog computing have emerged as new solutions to address this. These models place computing resources closer to users, significantly reducing latency and energy consumption while improving data processing efficiency. This paper presents a prediction system utilizing a fog-cloud framework, combining machine learning and deep learning with wearable IoT devices for real-time cardiovascular disease prediction. The system is trained using cardiovascular data from Gombe State, Nigeria, and evaluated based on energy consumption, precision, accuracy, recall, F1 score, and AUC. The proposed Optimized Naïve Bayes Random Forest (ONBRF) model offers a reliable and energy efficient approach to predicting heart disease.