Surah Luqman 31:12
وَلَقَدْ ءَاتَيْنَا لُقْمَـٰنَ ٱلْحِكْمَةَ أَنِ ٱشْكُرْ لِلَّهِ ۚ وَمَن يَشْكُرْ فَإِنَّمَا يَشْكُرُ لِنَفْسِهِۦ ۖ وَمَن كَفَرَ فَإِنَّ ٱللَّهَ غَنِىٌّ حَمِيدٌ
And We had certainly given Luqmān wisdom [and said], "Be grateful to Allāh." And whoever is grateful is grateful for [the benefit of] himself. And whoever denies [His favor] - then indeed, Allāh is Free of need and Praiseworthy.
Translation: Saheeh International
Tafsir
And verily We gave Luqmān wisdom comprising knowledge religiousness and right-mindedness in speech; his many wisdoms are well-known. He used to give legal opinions in matters of religion before David was summoned to prophethood but lived on into the latter’s summoning. …
Excerpt from Tafsir al-Jalalayn, commentary on 31:12, via Quran.com. The reader has the full commentary and 9 more tafsirs.