In recent years, the exponential growth of internet of things (IoT) and cyber physical systems (CPS) in safety critical applications has imposed severe reliability and security challenges. This is due to the heterogeneity and complex connectivity of the CPS components as well as error-prone and vulnerable nature of the underlying devices, harsh operating environments, and escalating security attacks. Different reliability threats (like soft errors, process variation and the temperature-induced dark silicon problem) have posed diverse challenges, which led to the development of various mitigation techniques on different layers of the CPS/IoT stack. Similarly, security threats (like manipulation of communication channels, hardware components and associated software) led to the development of different detection and protection techniques on different layers of the CPS/IoT stack, e.g., cross-layer and intra-layer connectivity. Towards this, the associated costs and overhead as well as potentially conflicting goals are important to be considered, e.g., most of the soft error mitigation techniques are based on redundancy and most of the security-related techniques require continuous runtime monitoring, obfuscation, attestation, and trusted execution environments. This paper first discusses different existing options for approaching this problem at different system layers, i.e., adaptive reliability and security management. These different solutions will provide a wide variety of options to choose from, as a basis for selection and adaptation, to solve reliability-related problems at design-Time and run-Time. Due to the exponential increase in the complexity and functional requirements, there is a trend towards employing Machine Learning in CPSs and IoT systems. Therefore, we will show how systems can be protected against different security and reliability threats when Machine Learning sub-systems are employed in CPS/IoT.