Al-An'am 6:68
وَإِذَا رَأَيْتَ ٱلَّذِينَ يَخُوضُونَ فِىٓ ءَايَـٰتِنَا فَأَعْرِضْ عَنْهُمْ حَتَّىٰ يَخُوضُوا۟ فِى حَدِيثٍ غَيْرِهِۦ ۚ وَإِمَّا يُنسِيَنَّكَ ٱلشَّيْطَـٰنُ فَلَا تَقْعُدْ بَعْدَ ٱلذِّكْرَىٰ مَعَ ٱلْقَوْمِ ٱلظَّـٰلِمِينَ
Wa-itha raayta allatheenayakhoodoona fee ayatina faaAAridAAanhum hatta yakhoodoo fee hadeethinghayrihi wa-imma yunsiyannaka ashshaytanufala taqAAud baAAda aththikra maAAaalqawmi aththalimeen
And when you see those who engage in [offensive] discourse concerning Our verses, then turn away from them until they enter into another conversation. And if Satan should cause you to forget, then do not remain after the reminder with the wrongdoing people.
When you see those who indulge in (blaspheming) Our verses, turn away from them until they become occupied with some other discourse. If Satan should cause you to forget (this instruction), then do not sit with the unjust people after recollection.