Network security is becoming a top priority for people, enterprises, and governments as the digital world advances. Innovative and flexible solutions will be needed due to the growing complexity and diversity of cyberthreats. Machine learning (ML) has become an effective means for improving network security because it can quickly identify, cease, and neutralize many kinds of threats. There are several uses for machine learning in the realm of network security. The applications of machine learning in network security are divided into two categories in this paper: Malware detection system and Intrusion Detection System (IDS) – Signature based IDS and Anomalybased IDS. A few machine learning techniques, such as Supervised learning, Unsupervised learning, and Reinforcement learning, that have been utilized in the field of network security and the threat landscape for network security between 2020 and 2023 is also discussed in this paper. Finally, a literature review of the machine learning techniques in the field of network security have also been discussed based on the survey of various research works.