Surah Sad 38:26
يَـٰدَاوُۥدُ إِنَّا جَعَلْنَـٰكَ خَلِيفَةً فِى ٱلْأَرْضِ فَٱحْكُم بَيْنَ ٱلنَّاسِ بِٱلْحَقِّ وَلَا تَتَّبِعِ ٱلْهَوَىٰ فَيُضِلَّكَ عَن سَبِيلِ ٱللَّهِ ۚ إِنَّ ٱلَّذِينَ يَضِلُّونَ عَن سَبِيلِ ٱللَّهِ لَهُمْ عَذَابٌ شَدِيدٌۢ بِمَا نَسُوا۟ يَوْمَ ٱلْحِسَابِ
[We said], "O David, indeed We have made you a successor upon the earth, so judge between the people in truth and do not follow [your own] desire, as it will lead you astray from the way of Allāh." Indeed, those who go astray from the way of Allāh will have a severe punishment for having forgotten the Day of Account.
Translation: Saheeh International
Tafsir
‘O David! We have indeed made you a vicegerent on the earth managing the affairs of people; so judge justly between people and do not follow desire that is the desires of the soul that it then lead you astray from the way of God that is to say from the proofs that indicate the truth of His Oneness. …
Excerpt from Tafsir al-Jalalayn, commentary on 38:26, via Quran.com. The reader has the full commentary and 9 more tafsirs.