(NH1) The importance of intention in our actions
On the authority of the Commander of the Faithful Abu Hafs Umar Ibn al Khattab, who said: I heard the Messenger of Allah (pbuh) say:

Actions are but by intention and every man shall have but that which he intended. Thus he whose migration was for Allah and His Messenger, his migration was for Allah and His Messenger, and he whose migration was to achieve some worldly benefit or to take some woman in marriage, his migration was for that for which he migrated.

(Migration in reference to religious migration from Mecca to Medina)

Related by al Bukhari and by an-Naisaburi, in their two Sahihs, which are the soundest of the compiled Hadith books.