Surah Al-Hajj 22:11
وَمِنَ ٱلنَّاسِ مَن يَعْبُدُ ٱللَّهَ عَلَىٰ حَرْفٍ ۖ فَإِنْ أَصَابَهُۥ خَيْرٌ ٱطْمَأَنَّ بِهِۦ ۖ وَإِنْ أَصَابَتْهُ فِتْنَةٌ ٱنقَلَبَ عَلَىٰ وَجْهِهِۦ خَسِرَ ٱلدُّنْيَا وَٱلْـَٔاخِرَةَ ۚ ذَٰلِكَ هُوَ ٱلْخُسْرَانُ ٱلْمُبِينُ
And of the people is he who worships Allāh on an edge. If he is touched by good, he is reassured by it; but if he is struck by trial, he turns on his face [to unbelief]. He has lost [this] world and the Hereafter. That is what is the manifest loss.
Translation: Saheeh International
Tafsir
And among mankind there are those who worship God on a knife-edge that is with uncertainty in his worship — such a person has been likened the knife- edge of a mountain in his precariousness — if good fortune befalls him so that he enjoys health and security with respect to his own self and his property he is …
Excerpt from Tafsir al-Jalalayn, commentary on 22:11, via Quran.com. The reader has the full commentary and 9 more tafsirs.