And never think that those who rejoice in what they have perpetrated and like to be praised for what they did not do - never think them [to be] in safety from the punishment, and for them is a painful punishment.
Chastising the People of the Scriptures for Breaking the Covenant and Hiding the Truth
In this Ayah, Allah chastises the People of the Scriptures, from whom Allah took the covenant by the words of their Prophets, that they would believe in Muhammad ﷺ and describe him to the people, so that they would recognize and follow him when Allah sent him. However, they hid this truth and preferred the the small amounts and the material gains instead of the rewards of this life and the Hereafter that they were promised. This is a losing deal and a failing trade, indeed.
These Ayat also contain a warning for the scholars not to imitate their behavior, so that they do not suffer the same fate and become like them. Therefore, the scholars are required to spread the beneficial knowledge that they have, encouraging the various righteous good deeds. They are also warned against hiding any part of their knowledge. A Hadith states that the Prophet said,
In continuation of the description of evils practiced by the Jews mentioned in previous verses, the first of the present two verses (187, 188) takes up yet another evil practice of theirs. This is their habit of going back on solemn pledges and covenants - for Allah Almighty had taken pledge from the people of the Book that they would communicate the commandments of Allah appearing in the Torah freely, openly and universally and that they would not conceal any injunction out of their selfish ends. The people of the Book broke this covenant. They concealed injunctions. Not only that, they were audacious enough to show their pleasure about having acted in this manner and taking this deed of theirs as commendable.
A man has to make the journey of faith in a world where he might be hurt in many ways, both by his own people as well as strangers. But under no circumstances should he fall prey to negative thoughts. He should rather confront every difficult situation as it comes and keep going on. He might be even provoked, but nonetheless he should restrain himself. He should bear every setback without resorting to vengeance. There might be many an occasion when his heart, unable to take any more suffering might tell him to break the bonds of God and act as his heart bids him. Still, the fear of God should stop him from taking such a step even then. The demands of religion inevitably require the ultimate sacrifice—which would mean sacrificing one’s life and wealth. In such a situation, one has to uphold religion by making sacrifices for its cause, though that might mean adopting the most difficult of the courses open to one. On the journey of faith, this is a tremendous test of courage and high-mindedness. Indeed, becoming a true believer is a trial which requires patience and piety. One who successfully qualifies in this test is the believer for whom the gates of Paradise will be thrown open in the Hereafter.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.