The emergence of COVID-19 emanating from Wuhan, China in December 2019 has deeply affected society at every level, impacting areas like public health, social well-being, and local economies globally. The study highlights mental health and its impact on social behavior during pandemics. The authors analyze Sri Lankan individuals' mental health issues through tweets presented using sentiment analysis techniques. A rigorous data preparation process was completed before filtering categorized data into three distinct groups: ‘experience', ‘information', and ‘counseling'. Three different machine learning algorithms were utilized for sentiment analysis, including ANN, LSTM, and SVM. In addition, the Latent Dirichlet Allocation technique was employed to identify topics from tweets during four waves of the COVID-19 outbreak, analyzing people's mental status and identifying conditions present. The findings contribute significantly to the evolving field of psychology during these trying times caused by COVID-19, providing much-needed guidance on implementing relevant support mechanisms.