(A Guiding Teacher is a Prerequisite)
You could see the sun when it rose coming from the right side of their cave, and when it set, it shone on them from the left, as they slept in the hollow thereof. This is one of God’s portents.* Whomever God guides is the truly guided one, and whomever He sends astray, you will not find for him a guiding teacher.
وَتَرَى الشَّمسَ إِذا طَلَعَت تَزٰوَرُ عَن كَهفِهِم ذاتَ اليَمينِ وَإِذا غَرَبَت تَقرِضُهُم ذاتَ الشِّمالِ وَهُم فى فَجوَةٍ مِنهُ ذٰلِكَ مِن ءايٰتِ اللَّهِ مَن يَهدِ اللَّهُ فَهُوَ المُهتَدِ وَمَن يُضلِل فَلَن تَجِدَ لَهُ وَلِيًّا مُرشِدًا
wa tarash shamsa izaa tala’at tazaawaru ‘an kahfihim zaatal yameeni wa izaa gharabat taqriduhum zaatash shimaali wa hum fee fajwatim minh; zaalika min Aayaatillaah; mai yahdil laahu fahuwal muhtad, wa mai yudlil falan tajida lahoo waliyyam murshidaa
*18:17 This sign, or hint, tells us that the cave was facing north.