Machin learning (ML) and Deep Learning (DL) technique have been widely applied to areas like image processing and speech recognition so far. Likewise, ML and DL play a critical role in detecting and preventing in the field of cybersecurity. In this review, we focus on recent ML and DL algorithms that have been proposed in cybersecurity, network intrusion detection, malware detection. We also discuss key elements of cybersecurity, the main principle of information security, and the most common methods used to threaten cybersecurity. Finally, concluding remarks are discussed, including the possible research topics that can be taken into consideration to enhance various cyber security applications using DL and ML algorithms.