In recent years, the advancements in the Internet of Medical Things (IoMT) or smart devices have enabled the automatic monitoring of human health. Using smart healthcare devices can not only reduce the burden on hospitals but also save costs, travel time, and provide a way to diagnose diseases at home, such as stroke rates. The IoMT generates a large amount of data, which can be used to train machine learning (ML) models for accurate disease diagnosis. However, the data used to train ML models is usually private, making it challenging to share and requiring high security. To overcome this challenge, this paper proposes a collaborative framework called TrustFedHealth for training ML-based heart disease prediction models. TrustFedHealth uses Federated Learning (FL) to allow training with decentralized data stored separately on multiple machines. Moreover, Mobile Edge Computing (MEC) is incorporated into the model as a solution to optimize communication time between the different elements of the system and reduce congestion. Homomorphic Encryption (HE) is also combined with FL to protect the confidentiality of model updates between clients and aggregation servers. Additionally, Blockchain (BC) is leveraged to tackle the traceability of contributions and guarantee transparency of model updates. Through evaluation results on the Physionet's MIT-BIH Arrhythmia Dataset, TrustFedHealth provides a promising approach for training ML-based heart disease prediction models while maintaining privacy and security.