Millions of people use the web every day, in this age of technology and the internet. Protecting the privacy and security of these users is a significant challenge for cybersecurity developers. With tremendous technological advancements, there is a noticeable improvement in the cyber-attackers' capabilities. At the same time, traditional Intrusion Detection Systems (IDS) are no longer effective at detecting intrusions. After the tremendous competences achieved by Artificial Intelligence (AI) techniques in all fields, great interest has developed in its use in the field of cybersecurity. There have been many studies that use Machine Learning (ML)-based intrusion detection systems. Despite the strong performance of ML techniques in detecting malicious activities, some challenges still reduce accuracy of performance. Knowing the proper technique, as well as knowing the features, is essential for effective intrusion detection. Therefore, this study proposes an effective network intrusion detection system based on ML and feature selection techniques. The performance of four ML techniques, the Random Forest (RF), K-Nearest Neighbors (KNN), Support Vector Machine (SVM) and the Decision Tree (DT) systems for intrusion detection are explored. In addition, feature selection techniques are employed for the selection of important features. Among the techniques used, the RF technique achieved the best performance, outperforming other techniques, with an accuracy of 99.72%. This study elaborates on the detection of malicious and benign cyber-attacks, with a new-level, high accuracy.