The usage of social media and the internet has grown rapidly throughout the world and has assimilated into daily life. Through the internet and social media, people can communicate their feelings, ideas, and thoughts, yet, with the growth of social networking sites, bullying is also growing. Cyberbullying is the term for bullying that involves the use of technology, and the internet may be a source of offensive, damaging, and destructive to other people’s content. Bullying can long-term affect young people’s capacity to socialize and build enduring friendships. Social media sites offer a great opportunity for bullying and harassment, and young people who use these sites are in danger. This paper’s framework was presented for detecting cyberbullying and divided into two main sections. NLP (natural language processing) is the first component, and ML is the second component (machine learning). In the first phase, data are collected from online news sources and Twitter, posts and messages on Facebook, Instagram, WhatsApp, and YouTube comments. Additionally, we collected data from the application that we built to receive complaints and threats that reach students and young people, regardless of the type of threat, whether bullying, intimidation, or even abuse in both English and Arabic. Before using machine learning algorithms on our data, we must clean it up and prepare it for the discovery phase because it contains many extraneous characters. To train the model and determine which model has the highest accuracy, we combine NLP with various machine learning techniques, including support vector machine, Naive Bayes, logistic regression, random forest, extreme gradient boosting algorithm, and convolutional neural networks (CNN). This paper developed an effective technology to detect and avoid bullying in social networks. Many workbooks are used to train and learn about bullying behavior. Evaluation of the proposed model for cyberbullying data shows that CNN performs better than other algorithms used in the study.