Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:18:110

Say, "I am only a man like you, to whom has been revealed that your god is one God. So whoever would hope for the meeting with his Lord - let him do righteous work and not associate in the worship of his Lord anyone."  

Say: ‘I am only a human being, a son of Adam, like you; it has been revealed to me that your God is only One God (annamā, the anna assimilated with the mā retains ˹its function of referring to˺ the verbal noun), in other words, the Oneness of the Divine is ˹what is being˺ revealed to me. So whoever hopes to encounter his Lord, through the Resurrection and the Requital, let him do righteous work and not associate with the worship of his Lord, that is to say, ˹let him not commit idolatry˺ in ˹performing˺ it by feigning ˹faith˺ before, anyone’. Meccan, except for verses 58 and 71, which are Medinese; it consists of 98, or 99, verses and was revealed after ˹sūrat˺ Fātir.
القرآن:١٨:١١٠

قُلْ إِنَّمَا أَنَا بَشَرٌ مِثْلُكُمْ يُوحَىٰ إِلَيَّ أَنَّمَا إِلَٰهُكُمْ إِلَٰهٌ وَاحِدٌ ۖ فَمَنْ كَانَ يَرْجُو لِقَاءَ رَبِّهِ فَلْيَعْمَلْ عَمَلًا صَالِحًا وَلَا يُشْرِكْ بِعِبَادَةِ رَبِّهِ أَحَدًا  

{قل إنما أنا بشر} آدمي {مثلكم يوحى إليَّ أنما إلهكم إله واحد} أن المكفوفة بما باقية على مصدريتها والمعنى: يوحى إليَّ وحدانية الإله {فمن كان يرجو} يأمل {لقاء ربه} بالبعث والجزاء {فليعمل عملاً صالحا ولا يشرك بعبادة ربه} أي فيها بأن يرائي {أحدا}.

See similar narrations below:

Collected by Ḥākim
hakim:3403Abū Zakariyyā al-ʿAnbarī > Muḥammad b. ʿAbd al-Salām > Isḥāq > al-Naḍr b. Shumayl > Abū Qurrah al-Asadī > Saʿīd b. al-Musayyib > ʿUmar b. al-Khaṭṭāb > Qāl Rasūl

[Machine] The Messenger of Allah ﷺ said: "Indeed, it has been revealed to me that whoever hopes to meet his Lord, then let him do good deeds and not associate anyone in the worship of his Lord. He will have a light from his home to Mecca and the angels will surround him."  

الحاكم:٣٤٠٣أَخْبَرَنَا أَبُو زَكَرِيَّا الْعَنْبَرِيُّ ثنا مُحَمَّدُ بْنُ عَبْدِ السَّلَامِ ثنا إِسْحَاقُ أَنْبَأَ النَّضْرُ بْنُ شُمَيْلٍ حَدَّثَنِي أَبُو قُرَّةَ الْأَسَدِيُّ قَالَ سَمِعْتُ سَعِيدَ بْنَ الْمُسَيِّبِ يُحَدِّثُ عَنْ عُمَرَ بْنِ الْخَطَّابِ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ «إِنَّهُ قَدْ أُوحِيَ إِلَيَّ أَنَّهُ مَنْ كَانَ يَرْجُو لِقَاءَ رَبِّهِ فَلْيَعْمَلْ عَمَلًا صَالِحًا وَلَا يُشْرِكْ بِعِبَادَةِ رَبِّهِ أَحَدًا كَانَ لَهُ نُورًا مِنْ أَبْيَنَ إِلَى مَكَّةَ حَشُّهُ الْمَلَائِكَةُ»  

هَذَا حَدِيثٌ صَحِيحُ الْإِسْنَادِ وَلَمْ يُخْرِجَاهُ أبو قرة فيه جهالة ولم يضعف