"Actions are (judged) by motives (niyyah), so each man will have what he intended. Thus, he whose migration (hijrah) was to Allah and His Messenger, his migration is to Allah and His Messenger; but he whose migration was for some worldly thing he might gain, or for a wife he might marry, his migration is to that for which he migrated."
[Al-Bukhari & Muslim]
Imam al-Harawi states that there are 7 types of self-desires:-
1. To make oneself appear good in the hearts of others
2. To seek the praises of others
3. To avoid being blamed by others
4. To seek the glorification of others
5. To seek the wealth/money of others
6. To seek the services or love of others
7. To seek the help of others for oneself
Ways to obtain ikhlas:
Do righteous deeds - the more good deeds we do and hence get closer to Allah, the more sincere we will be.
Before we do any deed we should firstly seek knowledge (ilm) - our actions/deeds should be guided by knowledge so that we do them in accordance to the Shariah.
Do not give false impressions - do not make others believe that an action we did was good when it was not.
Al-Imam Ahmad said: Before you do anything, check your intention (niyyah) - ask yourself before performing an action: "Is it for the sake of Allah?"
Ibnu al-Qayyim says: Any action we do is subject to three defects:
1. Being conscious that others are observing our actions
2. Seeking a return (benefit/reward) for the action
3. Being satisfied with the action
If we go to the masjid for the solah and we are early, arriving before the Imam and finding a place in the first saff, we should not be proud of ourselves and think of ourselves being better than others. We should praise Allah for enabling us to go to the masjid and for being able to perform the solah without any difficulties.
After every solah, we should tell ourselves that we could have performed it better and try to improve in our next solah.
What happens if we were to change our niyyah while performing an action? Ibn Rajab says according to the ulama' if the niyyah at the end of the action matches the beginning (i.e. doing the action for the sake of Allah), then any changes in the middle of the action will be forgiven or does not matter, insha Allah. However, if the niyyah at the end does not match the beginning, i.e. we do the action for other than the sake of Allah, then we must repent (taubah).
There are four things that contradict ikhlas:
1. Ma'siat - committing sins - this will weaken our ikhlas
2. Shirk - associating others with Allah
3. Riya' - performing an ibadah with the intention of showing off to others
4. Nifaq - hypocrisy
Even though we must always make sure that our actions do not deviate from ikhlas, there are actions, which are automatically considered that of good intentions. For example, seeking knowledge in Islam, helping the community, doing da'wah, etc.
Some rulings (ahkam) which scholars derived from this hadith:
1. When people 'swear by Allah' by saying "Wallahi" every now and then, their intention is not that they actually swear by Allah. They say it simply out of habit -it readily rolls off their tongue. Hence, it is harmless. However a Muslim should do his/her best to minimize it.
2. When someone is asked to give an oath, what is judged is his intention when he gives the oath.
3. There can be a combination of intentions between performing an ibadah and teaching others - we perform an ibadah for the sake of Allah, but we also do it with the intention of teaching others. e.g. when the Prophet, sallallahu 'alayhi wasallam, performed the Hajj, he did it for the sake of Allah as well as for teaching the Sahabah (his companions, may Allah be pleased with them all).
4. A man may go through the process of divorcing his wife, verbally or in court, but it is his intention which counts.
5. What could be seen as ghibah (backbiting - talking bad, but true, things about a person behind his back) could simply be a joke or a doa. If someone talks bad about someone else, it is his intentions, which determines whether it is ghibah or not.
Our actions are undermined by our intentions - whether they are good intentions or bad intentions. Therefore we should always check our intentions before we do or say anything. We must make sure that the action is for the sake of Allah so that it is accepted by Allah and that we will be rewarded for it, insya' Allah.