عن أبي هريرة رضي الله عنه مرفوعاً: «قال الله عز وجل : أنا عند ظنِّ عَبدي بي، وأنا معه حيث يَذكُرني، والله، لَلَّه أَفرَحُ بِتَوبَةِ عَبدِهِ مِنْ أَحَدِكُم يَجدُ ضَالَّتَهُ بالفَلاَة، وَمَنْ تَقَرَّب إِلَيَّ شِبْرًا، تقرَّبتُ إليه ذِرَاعًا، ومن تقرب إلي ذِراعًا، تقربت إليه بَاعًا، وإذا أَقْبَلَ إِلَيَّ يمشي أَقْبَلْتُ إِلَيهِ أُهَرْوِلُ». متفق عليه، وهذا لفظ إحدى روايات مسلم. وروي في الصحيحين: «وأنا معه حِينَ يَذْكُرُنِي» بالنون، وفي هذه الرواية. «حيث» بالثاء وكلاهما صحيح.
[صحيح] - [متفق عليه وها لفظ مسلم]
Abu Hurayrah (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) said: "Allah, Glorified and Exalted, said: 'I am as My slave thinks of Me, and I am with him wherever he remembers Me.' By Allah, Allah is more pleased with the repentance of His servant than one of you would be upon finding his lost camel in a barren desert. 'Whoever draws nearer to Me by a hand span, I draw nearer to him by a cubit; and whoever draws nearer to Me by a cubit, I draw nearer to him by a fathom; and whoever comes towards Me walking, I go to him running'" [Al-Bukhāri and Muslim]; this is the wording of one of the narrations of Imām Muslim. In another narration by Al-Bukhāri and Muslim, Allah says: "…And I am with him when he remembers Me," instead of: "...Wherever he remembers Me," as in this narration, and both narrations are authentic.
Sahih/Authentic. - [Al-Bukhari and Muslim]
Allah, the Almighty, is as His servant thinks of Him. If he expects good things of his Lord, then he shall receive good things, and if he does not, then he will receive what he expects to receive. In the Musnad (collection) of Imām Ahmad, Abu Hurayrah (may Allah be pleased with him) reports that the Prophet (may Allah's peace and blessings be upon him) said: "Allah, the Exalted, said: 'I am as my servant expects of me. If he thinks well of Me, then he shall be granted it, and if he thinks ill of me, than he shall be granted it." [Classified as Sahīh by Al-Albāni] The question is when and how does one think well of Allah? He does so when he acts good seeking to earn Allah's pleasure and reward. He does so by doing good deeds and then expecting that Allah will accept his deeds. On the other hand, to think well of Allah while not doing good deeds is only wishful thinking. The person who follows his desires and wishfully thinks that Allah will accept from him will gain nothing. Thinking well of Allah must be based on doing good deeds while expecting the reward from Allah. But to think well of Allah while you defy Him and rebel against Him with sin and disobedience, then this is the foolishness of the helpless people who are totally destitute. Ibn al-Qayyim (may Allah have mercy upon him) said: "There is no doubt that thinking well of Allah should necessarily be accompanied with righteousness. A righteous person expects that Allah would reward him for his righteousness, and he is certain that Allah does not go back on His promise and that He accepts repentance. As for the sinner who persists in committing major sins, transgressing, and violating Allah's laws, the utter misery caused by his sinfulness prevents him from thinking well of his Lord. The runaway slave who rebelled against his master never expects good things of his master. Committing an offense against someone can never coexist with having good expectations about him. A sinner's misery and despair is proportionate to the amount of sins he commits, just as the most obedient person to Allah is the one with the best expectations of him." Al-Hasan al-Basri said: "A believer thought well of his Lord, so he did good deeds, while a wicked person thought ill of Allah, so he did bad deeds." The Prophet (may Allah's peace and blessings be upon him) then said: "Allah is more pleased with the repentance of his slave." He then says that Allah is more generous than His servants; when they draw nearer to Him by a hand span, He draws nearer to them by a cubit (length of a forearm); when they draw nearer to Him by a cubit, He draws nearer to them by a fathom (a unit of length equal to six feet); and when they approach Him walking (at a normal pace), He approaches them running at a fast pace. Therefore, He is more beneficent, generous, and faster in responding than His servants can ever be. It is the creed of Ahl As-Sunnah wa al-Jamā‘ah to affirm to Allah the attribute of walking and running at a fast pace, but we do not know the manner in which He walks and runs and approaches His servants. This is a matter that only Allah knows, and it is something we should not discuss. We believe in its proper meaning in relation to the Majesty of Allah without delving into answering "how". Regarding the statement of Allah: "I am with him wherever He mentions me;" Allah's being with His slave is of two types: 1. Specific: whereby He supports His slave and gives him victory. This is the one mentioned in the narration. 2. General: which entails having knowledge and encompassing (everything). Ma‘iyyah, or being with His slave, is a true attribute of Allah in a way befitting Him.