Author: Shaykh Maulana Muhammad Zafar Iqbal Al-Hammad (May Allah protect him)
"Indeed, actions are judged by intentions, and every person will have what he intended. Therefore, whoever's migration is for the sake of worldly gain or to marry a woman, then his migration is for whatever purpose he intended."
[Sahih Bukhari: 1, 53, 2392, 3685, 4783, 6311, 6553]
This Hadith highlights the significance of intention. However, it does not mean that a bad action can become good simply through a good intention. Rather, the meaning is that permissible actions can become good or bad based on the intention behind them.
Hadith of Umar bin Khattab (may Allah be pleased with him):
Umar bin Khattab (may Allah be pleased with him) once sat on the pulpit and said that he heard the Messenger of Allah (peace be upon him) say:"Indeed, actions are judged by intentions, and every person will have what he intended. Therefore, whoever's migration is for the sake of worldly gain or to marry a woman, then his migration is for whatever purpose he intended."
[Sahih Bukhari: 1, 53, 2392, 3685, 4783, 6311, 6553]
Benefit:
In the most reliable books of Hadith, the background of this narration is mentioned: A man proposed to a woman named "Um Qais," who stipulated that he should migrate to her location for the marriage to proceed. Thus, he migrated, and the woman married him. The Companions (may Allah be pleased with them) used to refer to this man as "the migrant of Um Qais." [Al-Ta'liq al-Sabeeh, Vol. 1, p. 57]This Hadith highlights the significance of intention. However, it does not mean that a bad action can become good simply through a good intention. Rather, the meaning is that permissible actions can become good or bad based on the intention behind them.