Chapter 6, Verse 68, The cattle
سورة الأنعام
وَإِذَا رَأَيۡتَ ٱلَّذِينَ يَخُوضُونَ فِيٓ ءَايَٰتِنَا فَأَعۡرِضۡ عَنۡهُمۡ حَتَّىٰ يَخُوضُواْ فِي حَدِيثٍ غَيۡرِهِۦۚ وَإِمَّا يُنسِيَنَّكَ ٱلشَّيۡطَٰنُ فَلَا تَقۡعُدۡ بَعۡدَ ٱلذِّكۡرَىٰ مَعَ ٱلۡقَوۡمِ ٱلظَّٰلِمِينَ
And when you (Muhammad ﷺ) see those who engage in a false conversation about Our verses (of the quran) by mocking at them, stay away from them till they turn to another topic. And if Shaitan (Satan) causes you to forget, then after the remembrance sit not you in the company of those people who are the Zalimun (polytheists and wrong-doers, etc.).
Chapter 24, Verse 58, The Light
سورة النور
يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُواْ لِيَسۡتَـٔۡذِنكُمُ ٱلَّذِينَ مَلَكَتۡ أَيۡمَٰنُكُمۡ وَٱلَّذِينَ لَمۡ يَبۡلُغُواْ ٱلۡحُلُمَ مِنكُمۡ ثَلَٰثَ مَرَّٰتٖۚ مِّن قَبۡلِ صَلَوٰةِ ٱلۡفَجۡرِ وَحِينَ تَضَعُونَ ثِيَابَكُم مِّنَ ٱلظَّهِيرَةِ وَمِنۢ بَعۡدِ صَلَوٰةِ ٱلۡعِشَآءِۚ ثَلَٰثُ عَوۡرَٰتٖ لَّكُمۡۚ لَيۡسَ عَلَيۡكُمۡ وَلَا عَلَيۡهِمۡ جُنَاحُۢ بَعۡدَهُنَّۚ طَوَّٰفُونَ عَلَيۡكُم بَعۡضُكُمۡ عَلَىٰ بَعۡضٖۚ كَذَٰلِكَ يُبَيِّنُ ٱللَّهُ لَكُمُ ٱلۡأٓيَٰتِۗ وَٱللَّهُ عَلِيمٌ حَكِيمٞ
O you who believe! Let your legal slaves and slave-girls, and those among you who have not come to the age of puberty ask your permission (before they come to your presence) on three occasions; before Fajr (morning) prayer, and while you put off your clothes for the noonday (rest), and after the 'Isha' (late-night) prayer. (These) three times are of privacy for you, other than these times there is no sin on you or on them to move about, attending (helping) you each other. Thus Allah makes clear the Ayat (the verses of this quran, showing proofs for the legal aspects of permission for visits, etc.) to you. And Allah is All-Knowing, All-Wise.