عَنِ ابْنِ عَبَّاسٍ رَضِيَ اللَّهُ عَنْهُ أَنَّهُ رَكِبَ خَلْفَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ يَوْمًا فَقَالَ لَهُ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ: ((يَا غُلَامُ! إِنِّي مُعَلِّمُكَ كَلِمَاتٍ (يَنْفَعُكَ اللَّهُ بِهَا) احْفَظِ اللَّهَ يَحْفَظْكَ، احْفَظِ اللَّهَ تَجِدْهُ تُجَاهَكَ، وَإِذَا سَأَلْتَ فَاسْأَلِ اللَّهَ، وَإِذَا اسْتَعَنْتَ فَاسْتَعِنْ بِاللَّهِ، وَاعْلَمْ أَنَّ الْأُمَّةَ لَوِ اجْتَمَعُوا عَلَى أَنْ يَنْفَعُوكَ لَمْ يَنْفَعُوكَ إِلَّا بِشَيْءٍ قَدْ كَتَبَ اللَّهُ لَكَ، وَلَوِ اجْتَمَعُوا عَلَى أَنْ يَضُرُّوكَ لَمْ يَضُرُّوكَ إِلَّا بِشَيْءٍ قَدْ كَتَبَهُ اللَّهُ عَلَيْكَ، رُفِعَتِ الْأَقْلَامُ وَجَفَّتِ الصُّحُفُ))
It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that one day he was riding behind the Messenger of Allah (peace and blessings be upon him), and the Prophet (peace and blessings be upon him) said to him: "O boy! I am going to teach you some words; Allah Almighty will benefit you through them. Guard (the commandments of) Allah, He will guard you. Guard (the commandments of) Allah, you will find Him before you. Whenever you ask, ask from Allah, and whenever you seek help, seek help from Allah. And know that if the entire Ummah were to gather together to benefit you with something, they would not be able to benefit you except with that which Allah has written for you. Similarly, if the entire Ummah were to gather together to harm you with something, they would not be able to harm you except with that which Allah has written against you. The pens have been lifted and the pages have dried."