The emergence of Internet of Things (IoT) devices is revolutionizing healthcare. This dynamic healthcare environment relies on Internet of Healthcare Things (IoHT) and Internet of Medical Things (IoMT) technologies. Economic, social, and technological opportunities from the IoHT are transforming healthcare systems. This article covers the history, present condition, and future prospects of IoHT, as well as its topologies, platforms, services, applications, market trends, and solution types. It examines security issues, requirements, and a threat taxonomy, studying smart healthcare privacy and security. It explores future research and the challenges IoHT-based solutions face. International health rules and regulations based on the IoT and their social and economic effects on long-term development are also examined. Integrating IoMT into healthcare infrastructures enhances scalability, efficiency, reliability, and accuracy. Through communication networks and data-processing algorithms, IoMT creates smart hardware and software platforms that enhance decision-making. IoMT devices' low resources raise privacy and security concerns. Security and privacy issues are organised by healthcare IoMT adoption in this study. We give an extensive attack taxonomy against the IoMT infrastructure, encompassing devices, security mechanisms, and their pros and cons. Furthermore, it describes the privacy and security requirements for any unique security solutions against IoMT's multiple attack vectors. This article explains the complicated difficulties, security concerns, and future research pathways needed to safeguard and ensure the long-term expansion of these game-changing technologies in the healthcare ecosystem.