Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:28:55

And when they hear ill speech, they turn away from it and say, "For us are our deeds, and for you are your deeds. Peace will be upon you; we seek not the ignorant."  

And when they hear vanity, vile words and hurtful intent from the disbelievers, they disregard it and say, ‘To us ˹belong˺ our deeds and to you ˹belong˺ your deeds. Peace to you — a parting truce (salām mutāraka), in other words you are secure from any abuse or the like on our part. We do not desire ˹friendship with˺ the ignorant’, we do not seek companionship with them.
القرآن:٢٨:٥٥

وَإِذَا سَمِعُوا اللَّغْوَ أَعْرَضُوا عَنْهُ وَقَالُوا لَنَا أَعْمَالُنَا وَلَكُمْ أَعْمَالُكُمْ سَلَامٌ عَلَيْكُمْ لَا نَبْتَغِي الْجَاهِلِينَ  

{وإذا سمعوا اللغو} الشتم والأذى من الكفار {أعرضوا عنه وقالوا لنا أعمالنا ولكم أعمالكم سلام عليكم} سلام متاركة أي سلمتم منا من الشتم وغيره {لا نبتغي الجاهلين} لا نصحبهم.