The digital age has led to a significant increase in text data, including social media updates, articles, and text messages. The ability to understand and extract emotions from this data is crucial in fields such as customer service analysis, psychological research, and social studies. It allows businesses and organizations to gain insight into customer opinions and emotions, leading to better decision-making and alignment with customer needs. However, accurately detecting emotions from text poses challenges due to linguistic structures, cultural nuances, and contextual differences. Although artificial intelligence and text analysis models have made progress in addressing these challenges, there is still a need for more sophisticated methodologies to understand textual content and explore emotions. This study aims to employ a range of machine learning and deep learning methods, including logistic regression, Extra tree classifier, voting classifier, SGD, linearSVC, BiLSTM, BERT, RoBERTa, and DistilBERT, to detect emotions in textual content. The objective is to analyze and compare the outcomes of these methods. This involves extracting features and semantic relationships using techniques such as Word2Vec and FastText, and integrating them with features derived from TF-IDF, Bag of Words (BoW), and N-grams. The findings demonstrate the effectiveness of various models. Specifically, the SGD model utilizing N-grams and FastText achieved an accuracy of 88.42\% on the AIT-2018 dataset, while LinearSVC using N-grams and Word2Vec achieved an accuracy of 88.23\% on the ISEAR dataset. It is worth noting that the BERT transformer model outperformed others, achieving an accuracy of 93.67\% on the AIT-2018 dataset and 89.49\% on the ISEAR dataset. These results align with previous studies, further supporting their reliability and coherence.