Machine learning (ML) is a subfield of Artificial Intelligence (AI) that contributes to the development of systems that can learn from previous data, spot patterns, and make logical judgments with little human interaction. Cybersecurity methodologies provide modern security solutions for detecting and responding to threats. As a result of thieves' ability to circumvent traditional security measures, the previously utilized security solutions are no longer enough. Protecting digital systems from hostile assaults, including those on computers, servers, mobile devices, networks, and associated data, is the practice of cyber security. Accounting for cyber security where machine learning is used and using ML to enable cyber security are the two main components of combining cyber security and ML. We may benefit from this union in a number of ways, including by giving ML models better security, enhancing the effectiveness of cyber security techniques, and enabling the efficient detection of zero-day threats with minimal human involvement. We combine cyber security and ML to address two distinct themes in this survey article. By providing ML strategies for cyber security, the purpose of this paper is to give a wide overview of ML methods employed in cyberspace security.