Surah Az-Zumar 39:18
ٱلَّذِينَ يَسْتَمِعُونَ ٱلْقَوْلَ فَيَتَّبِعُونَ أَحْسَنَهُۥٓ ۚ أُو۟لَـٰٓئِكَ ٱلَّذِينَ هَدَىٰهُمُ ٱللَّهُ ۖ وَأُو۟لَـٰٓئِكَ هُمْ أُو۟لُوا۟ ٱلْأَلْبَـٰبِ
Who listen to speech and follow the best of it. Those are the ones Allāh has guided, and those are people of understanding.
Translation: Saheeh International
Tafsir
who listen to the words of God and follow the best sense of it which is that which contains the means to righteousness for them. Those they are the ones whom God has guided; and those they are the people of pith the possessors of intellect.
Excerpt from Tafsir al-Jalalayn, commentary on 39:18, via Quran.com. The reader has the full commentary and 9 more tafsirs.