In recent years, smart city services have moved the existence of people from the physical to the virtual world (cyberspace), e.g. online banking, e-commerce, telemedicine, etc. Online content is a crucial part of smart city and sustainable management of it is a primary task of current society. Along with the benefits of smart cities, the problems of the physical world are also shifted to the cyber world, like harassment in the covid 19 Pandemic situation. Especially for young people, cyber bullying even could lead them to do self-harm and suicide. Researchers also studied an association between cyber bullying victimization and suicidal ideation risks. It is an essential and challenging task to detect cyber bullying. As for importance, to minimize the harm of cyber bullying as much as possible, it is more important to developing an automatic model to predict cyber bullying events, rather than checking them manually or remedying them afterward. Here, we use the machine learning algorithm namely Logistic Regression, Random Forest, Decision Tree, Support vector machine, K-Nearest Neighbor to categorize the threat in cyber bullying detection of the system. Experimental results show the better performance of the system.