Sure An-Noor

24:29

لَّيْسَ عَلَيْكُمْ جُنَاحٌ أَن تَدْخُلُوا۟ بُيُوتًا غَيْرَ مَسْكُونَةٍۢ فِيهَا مَتَٰعٌۭ لَّكُمْ ۚ وَٱللَّهُ يَعْلَمُ مَا تُبْدُونَ وَمَا تَكْتُمُونَ

Es ist für euch keine Sünde, unbewohnte Häuser zu betreten, in denen sich ein Nießbrauch für euch befindet. Allah weiß, was ihr offen tut und was ihr heimlich tut.

Tafsir 24:29

There is no blame on you, for entering without permission, public houses which are not specifically for any person and which have been prepared for general benefit, such as libraries and shops in markets. Allah knows the actions and conditions which you display and which you hide; none of that is hidden from Him and He shall reward you for them.