Mishkat al-Masabih 87
وَعَن عمرَان بن حضين: إِن رجلَيْنِ من مزينة أَتَيَا رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَقَالَا يَا رَسُولَ اللَّهِ أَرَأَيْتَ مَا يَعْمَلُ النَّاسُ الْيَوْمَ وَيَكْدَحُونَ فِيهِ أَشِيءٌ قُضِيَ عَلَيْهِمْ وَمَضَى فيهم من قدر قد سَبَقَ أَوْ فِيمَا يَسْتَقْبِلُونَ بِهِ مِمَّا أَتَاهُمْ بِهِ نَبِيُّهُمْ وَثَبَتَتِ الْحُجَّةُ عَلَيْهِمْ فَقَالَ لَا بَلْ شَيْءٌ قُضِيَ عَلَيْهِمْ وَمَضَى فِيهِمْ وَتَصْدِيقُ ذَلِكَ فِي كِتَابِ اللَّهِ عَزَّ وَجَلَّ (وَنَفْسٍ وَمَا سواهَا فألهمها فجورها وتقواها) رَوَاهُ مُسلم
From ʿImran ibn Husayn that two men from Muzaynah came to the Messenger of Allah ﷺ and said: "O Messenger of Allah, tell us about what people do today and toil in: is it something decreed for them and passed upon them from a decree that has preceded, or is it in what they face anew of what their prophet brought them, the proof having been established against them?" He said: "No, rather it is something decreed for them and passed upon them, and the confirmation of that is in the Book of Allah, Mighty and Majestic: 'And [by] a soul and He who proportioned it, and inspired it [with discernment of] its wickedness and its righteousness.'" Reported by Muslim.