Quran verse on avoiding irrelevant Ai-Isra 17: 53 Al-Mu'minun 23: 03

Allah Subhanahu wa Ta'ala said to
His Prophet Sallallahu 'alaihi

And say to My slaves (believers)
that they should (only) say those
words that are the best (in which
no one's heart is hurt). Because
Shaitan, verily, provokes discord
among them. Surely, Shaitan is to
man an open enemy. Ai-Isra 17: 53

While mentioning the qualities of
believers Allah Subhanahu wa
Ta'ala says:

And those who turn away from un
profitable and shameful talk and
actions. Al-Mu'minun 23: 03