The Internet of Things (IoT) connects billions of intelligent devices that can communicate with each other without human intervention. With an estimated 50 billion devices by the end of 2020, it is one of the fastest growing areas of computing history. On the other hand, IoT technology is essential to the advancement of various real-world intelligent applications that can improve people's quality of life. However, the interdisciplinary components involved in networking and deploying IoT systems raise new security concerns. Encryption, authentication, access control, network security, and application security solutions are worthless when it comes to IoT devices and their inherent shortcomings. Therefore, existing security measures need to be updated to properly protect the IoT environment. Machine learning and deep learning (ML / DL) have evolved dramatically in recent years, and machine intelligence has evolved from laboratory curiosity to viable machines. An important defense against new or zero-day attacks is the ability to intelligently monitor IoT devices. ML / DL is a powerful data exploration technique for revealing "normal" and "bad" behavior in the context of IoT components and devices. Therefore, machine learning and deep learning technologies are important not only to enable secure device communication, but also to transform IoT security into a security-based intelligence system. The purpose of this study is to provide a comprehensive overview of recent advances in machine learning and deep learning techniques that can be used to improve IoT security solutions. It describes the many possible attack surfaces of IoT systems, the potential risks associated with each surface, and lists unique or newly established IoT security threats. It then details the ML / DL approach to IoT security, highlighting the potential, strengths, and weaknesses of each method. Learn about the possibilities and challenges of using machine learning and deep learning for IoT security. These opportunities and challenges may be used as future research paths.