Surah Al-Baqara

2:115

وَلِلَّهِ ٱلْمَشْرِقُ وَٱلْمَغْرِبُ ۚ فَأَيْنَمَا تُوَلُّوا۟ فَثَمَّ وَجْهُ ٱللَّهِ ۚ إِنَّ ٱللَّهَ وَٰسِعٌ عَلِيمٌۭ

And to Allah belongs the east and the west. So wherever you [might] turn, there is the Face of Allah. Indeed, Allah is all-Encompassing and Knowing.

Tafsir 2:115

Allah has authority over the entire world, and He instructs His servants as He wills. Wherever you turn, you will find Allah: He surrounds His creation. Whether He instructs you to face Jerusalem or the Kaaba, or you make a mistake in the direction of prayer or are not sure of it, then it is not an issue, because to Allah belongs every direction. Allah is vast in His blessings; He covers His creation with His mercy and ease. He knows their intentions and everything that they do.