Sayyiduna Abdullah bin Ja'far (may Allah be pleased with him) relates that the Prophet (peace and blessings be upon him) seated him behind himself on his mount and said: "O young man, shall I not give you something? Shall I not teach you words through which Allah Almighty will benefit you? Guard (the commands of) Allah Almighty and He will guard you. Keep your attention towards Allah and you will find Him with you. When you ask, ask Allah Almighty; and when you seek help, seek help from Allah Almighty. Know that the pen has dried regarding whatever is to be. Know that if the whole of creation intended something for you that has not been written against you, they would not be able to prevail over you. And know that help comes with patience, relief comes with distress, and with hardship there is ease."
Al-Tabarani recorded it; its chain contains Ali bin Abi Ali al-Qurashi, who is da'if (weak).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب القدر / 11795