HadithT0Consensus VerifiedSahih al-Bukhari #1
Actions are judged by intentions (niyyah)
The Prophet (SAW) said: 'Actions are only by intentions, and everyone shall have only what they intended.' This hadith establishes the foundational principle that the validity and reward of every deed in Islam is determined by the intention behind it.
إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى