An-Nur 24:27
يَـٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ لَا تَدْخُلُوا۟ بُيُوتًا غَيْرَ بُيُوتِكُمْ حَتَّىٰ تَسْتَأْنِسُوا۟ وَتُسَلِّمُوا۟ عَلَىٰٓ أَهْلِهَا ۚ ذَٰلِكُمْ خَيْرٌ لَّكُمْ لَعَلَّكُمْ تَذَكَّرُونَ
Ya ayyuha allatheena amanoola tadkhuloo buyootan ghayra buyootikum hattatasta/nisoo watusallimoo AAala ahliha thalikumkhayrun lakum laAAallakum tathakkaroon
O you who have believed, do not enter houses other than your own houses until you ascertain welcome and greet their inhabitants. That is best for you; perhaps you will be reminded [i.e., advised].
O you who believe, do not enter any houses, other than your own houses unless you seek permission and greet their inmates with Salām . That is good for you, so that you may be heedful.