Actions Are by Intentions
The very first hadith of Sahih al-Bukhari — the most authentic collection of the Prophet's teachings. It is the hadith every student of Islam meets first, because it sets the rule for everything that follows.
Sahih al-Bukhari · Book 1 (Revelation) · Hadith No. 1 · Narrated by 'Umar bin Al-Khattab
In English
“Narrated 'Umar bin Al-Khattab: I heard Allah's Messenger (ﷺ) saying, "The reward of deeds depends upon the intentions and every person will get the reward according to what he has intended. So whoever emigrated for worldly benefits or for a woman to marry, his emigration was for what he emigrated for”
In Arabic
«حَدَّثَنَا الْحُمَيْدِيُّ عَبْدُ اللَّهِ بْنُ الزُّبَيْرِ ، قَالَ : حَدَّثَنَا سُفْيَانُ ، قَالَ : حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ الْأَنْصَارِيُّ ، قَالَ : أَخْبَرَنِي مُحَمَّدُ بْنُ إِبْرَاهِيمَ التَّيْمِيُّ ، أَنَّهُ سَمِعَ عَلْقَمَةَ بْنَ وَقَّاصٍ اللَّيْثِيَّ ، يَقُولُ : سَمِعْتُ عُمَرَ بْنَ الْخَطَّابِ رَضِيَ اللَّهُ عَنْهُ عَلَى الْمِنْبَرِ، قَالَ : سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ، يَقُولُ : " إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ»
Why intentions matter
Two people can do the very same action — pray, give money, travel, study — and receive completely different rewards, because what counts is why they did it. The Prophet (peace be upon him) gives an example from his own time: some people emigrated to Madinah for the sake of Allah, and others emigrated for a worldly benefit or to marry a woman. The journey was the same; the reward was not.
That is why scholars put this hadith first: before you learn what to do, learn why you do it. Check your intention before an action, and renew it during it. A small deed done sincerely is worth more than a great deed done for show.
Try it today: before your next prayer, pause for five seconds and say to yourself, in your own words, why you are praying. That pause is the hadith in practice.
English text quoted exactly from the English edition (fawazahmed0/hadith-api, eng-bukhari); Arabic text from the Arabic edition (ara-bukhari). The collection is Sahih al-Bukhari — an authentic collection; the API lists no separate grade for this hadith. Reference: sunnah.com/bukhari:1.