But as for one who believes and does righteousness, he will have a reward of the best [i.e., Paradise], and we [i.e., Dhul-Qarnayn] will speak to him from our command with ease."
His traveling and reaching the Place where the Sun sets (the West)
فَأَتْبَعَ سَبَباً
(So he followed a way.) Ibn `Abbas said that he followed different routes to achieve what he wanted.
فَأَتْبَعَ سَبَباً
(So he followed a way.) Mujahid said that he followed different routes, east and west. According to one report narrated from Mujahid, he said:
سَبَباً
(a way) means, "A route through the land." Qatadah said, "It means he followed the routes and landmarks of the earth."
حَتَّى إِذَا بَلَغَ مَغْرِبَ الشَّمْسِ
(Until, when he reached the setting place of the sun,) means, he followed a route until he reached the furthest point that could be reached in the direction of the sun's setting, which is the west of the earth. As for the idea of his reaching the place in the sky where the sun sets, this is something impossible, and the tales told by storytellers that he traveled so far to the west that the sun set behind him are not true at all. Most of these stories come from the myths of the People of the Book and the fabrications and lies of their heretics.
The statement in verse 86: حَتَّىٰ إِذَا بَلَغَ مَغْرِبَ الشَّمْسِ (until when he reached where the sun sets) means that he reached the far limit towards the West beyond which there was no populated area.
The word: حَمِئَةٍ (Hami'ah) in the succeeding phrase: فِي عَيْنٍ حَمِئَةٍ (into a miry spring) literally means dark marsh or mud carrying the sense of water beneath which there is dark mud and which causes the water it-self to appear black. As for the sense of his seeing the Sun setting into such a spring, it means that an onlooker perceived it as setting into the spring because there was no habitation or dry land in sight. This is like being in an open field while the Sun is setting where as far as one can see there appears to be no mountain, tree, or structure, naturally one who looks at the sight would feel that the Sun was sinking into the land mass.
Dhu’l-Qarnayn, in making his conquests, possibly proceeded in a westward direction from Iran, and thus reached Asia Minor, halting only when he came to the ‘black water’ of the Aegean Sea. If one stands on the sea-shore here and looks out over the sea in the evening, it will appear as if the sphere of the sun is sinking into the water and setting there. This is a figurative description of the furthermost point which Dhu’l-Qarnayn reached. Dhu’l-Qarnayn had reached this seashore not as a wayfarer but as a conqueror. Thus he gained full control over the people inhabiting that area and established his rule there. As a ruler he had full powers to deal with the inhabitants as he liked. But Dhu’l-Qarnayn was a just king. He was not cruel to anybody. He made the general announcement that he would deal severely only with anyone found indulging in evil deeds and that no excess would be perpetrated upon those who maintained peace and order.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.