Presently, smart cities play a vital role to enhance the quality of living among human beings in several ways such as online shopping, e-learning, ehealthcare, etc. Despite the benefits of advanced technologies, issues are also existed from the transformation of the physical word into digital word, particularly in online social networks (OSN). Cyberbullying (CB) is a major problem in OSN which needs to be addressed by the use of automated natural language processing (NLP) and machine learning (ML) approaches. This article devises a novel search and rescue optimization with machine learning enabled cybersecurity model for online social networks, named SRO-MLCOSN model. The presented SRO-MLCOSN model focuses on the identification of CB that occurred in social networking sites. The SRO-MLCOSN model initially employs Glove technique for word embedding process. Besides, a multiclass-weighted kernel extreme learning machine (M-WKELM) model is utilized for effectual identification and categorization of CB. Finally, Search and Rescue Optimization (SRO) algorithm is exploited to fine tune the parameters involved in the M-WKELM model. The experimental validation of the SRO-MLCOSN model on the benchmark dataset reported significant outcomes over the other approaches with precision, recall, and F1-score of 96.24%, 98.71%, and 97.46% respectively.