The influence of the Internet of Things (IoT) on how people live, interact and conduct business has rapidly increased. Integrating physical objects with electronic networking, or the Internet of Things (IoT), allows for better communication and environment detection. In coming years, higher service levels will be offered by IoT-based technologies, remarkably changing how people would conduct their daily lives. Currently, the number "things" (physical items) connected to the internet exceeds 9 billion. This number is expected quickly to reach around 20 billion. IoT applications in everyday life include smart wearables, smart health monitoring, traffic monitoring, IoT in agriculture with many sensors, smart devices, robots in hospitals, smart grid and water supply and so on. It can help make mobile phone control over homes and cities more intelligent. It provides personal protection as well as improved security. We save a great deal of time by automating tasks. Even when we are far from where we actually are, we can still conveniently get information because it is constantly updated. The internet of things truly has many applications, particularly when paired with other technologies like artificial intelligence and machine learning. This is especially true since it is now possible to put sensors in almost any item, resulting in the creation of a linked internet of things network. This is made possible by the dropping costs of hardware. IoT has numerous uses in supply chain management, manufacturing, smart energy production and wildlife conservation, among other areas. Perhaps, in the end, this growing number of IoT applications will result in a smart planet. Nonetheless, these technologies' security flaws still cause problems for IoT-based data transmission. IoT inherits the common security problems associated with traditional networks because it is made up of a collection of networks and computing devices. IoT devices have also been vulnerable to other forms of exploitation and cyberattacks. This is because an environment with limited resources makes it difficult to adopt advanced cybersecurity safeguards. Hence, it is imperative to safeguard the entire internet of things architecture from potential vulnerabilities that could jeopardize the confidentiality, privacy and general integrity of the system. Lightweight security solutions are needed since IoT devices have limited resources and the traditional security processes are burdensome. Implementing security measures such as secure authentication, encryption and software upgrades is vital to addressing issues and making sure IoT systems and devices are operating safely and securely. IoT is an area where a lot of work is being done in terms of security and threats. Surveys on IoT security and risks currently available only focus on one aspect of security in IoT at a time. No survey addresses security risks in the architecture and ecosystem of the internet of things along with potential solutions. This survey gives a thorough analysis that addresses potential strate...