The Internet of Things (IoT) rapidly evolves, presenting challenges and opportunities. This study emphasises the critical role of software in advancing IoT technologies, focusing on machine learning (ML), fog computing, and process optimisation for security and resiliency. ML is pivotal in IoT for predicting equipment failures, evaluating process efficiency, and enabling informed decision- making through real-time data analysis. By integrating ML models directly into IoT devices (edge computing), latency is reduced, and data transmission needs are minimised. Fog computing and cloud computing address latency issues by moving computational resources closer to IoT devices, enhancing scalability and optimising network resource usage. Security remains a paramount concern due to the increasing number of connected devices and their vulnerabilities. IoT software must balance efficiency, security, and performance, employing deep learning for anomaly detection, blockchain for data transparency, and optimised encryption protocols. The trend towards distributed architectures like Edge Computing enhances system resilience by reducing latency and increasing fault tolerance. The proposed IoT system architecture is a three-tier structure consisting of Edge, Fog, and Cloud levels. At the Edge level, initial data processing occurs directly on IoT devices, reducing latency and network load. The Fog level processes data within the local network, utilising more powerful computational resources for complex tasks and ensuring security through advanced machine learning and encryption. The Cloud level serves as a central repository for long-term storage and global data analysis, leveraging containerisation and orchestration technologies for scalability and reliability. This multi-layered architecture ensures efficient data processing, high security, and adaptability, making it suitable for real-time applications. The study highlights the importance of software in optimising data processing across these levels, ensuring the IoT system’s resilience, scalability, and long-term sustainability.