Sentiments are the key factors that lead to influence our behavior. Sentiment analysis is a technique that analyzes people’s behaviors, attitudes, and emotions toward a service, product, topic, or event. Since 2020, no country has remained untouched by COVID-19, and the governing bodies of most countries have been applying several anti-pandemic countermeasures to combat it. In this regard, it becomes tremendously important to analyze people’s sentiments when tackling infectious diseases similar to COVID-19. The countermeasures taken by any country to control the pandemic leave a direct and crucial impact on each sector of public life, and every individual reacts to them differently. It is necessary to consider these reactions to implement appropriate messaging and decisive policies. Pakistan has done enough to control this virus’s spread like every other country. This research aims to perform a sentimental analysis on the famous microblogging social platform, Twitter, to get insights into public sentiments and the attitudes displayed towards the precautionary steps taken by the Government of Pakistan in the years 2020 and 2021. These steps or countermeasures include the closure of educational institutes, suspension of flight operations, lockdown of business activities, enforcement of several standard operating procedures (SOPs), and the commencement of the vaccination program. We implemented four approaches for the analysis, including the Valence Aware Dictionary and sEntiment Reasoner (VADER), TextBlob, Flair, and Bidirectional Encoder Representations from Transformers (BERT). The first two techniques are lexicon-based. Flair is a pre-trained embedding-based approach, whereas BERT is a transformer-based model. BERT was fine-tuned and trained on a labeled dataset, achieving a validation accuracy of 92%. We observed that the polarity score kept varying from month to month in both years for all countermeasures. This score was analyzed with real-time events occurring in the country, which helped understand the public’s sentiment and led to the possible formation of a notable conclusion. All implemented approaches showed independent performances. However, we noticed from the classification results of both TextBlob and the fine-tuned BERT model that neutral sentiment was dominant in the data, followed by positive sentiment.