Narrated Sahl bin Sa'd As-Sa'idi: that a man peeked in on the Messenger of Allah ﷺ, in one of the apartments of the Prophet ﷺ, while the Prophet ﷺ had a Midrah (an iron comb) with which he was scratching his head. So the Prophet ﷺ said: "If I knew that you were looking then I would have poked your eyes with it. Seeking permission has only been enjoined because of the sight".
The Prophet's words also remind us to be mindful when we enter someone else's space, whether it is their home or any other place where they may feel uncomfortable if we enter without asking for their consent first. We must always remember to show respect and consideration for others by asking for their permission before entering their personal space or engaging in any activity that could potentially cause them discomfort or distress.