It is narrated on the authority of Amirul Mu'minin, Abu Hafs 'Umar bin al-Khattab, radiyallahu 'anhu, who said: I heard the Messenger of Allah, sallallahu 'alayhi wasallam, say:
"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."
Renew your intention every time you do something for the sake of Allah - even if it is a regular act. This is epecially important in preventing the deed in becoming merely a mechanical act, for the wrong reasons, and also to reap the full rewards. Just by intending on doing something for the sake of our Creator can bring manifold rewards (ajar) via trivial acts.
It is our continued struggle that we make our actions 100% sincerely fi sabilillah (in the way of Allah).
To achieve ikhlas, we have to avoid shirk (associating others with Allah, which causes insincerity). Al-Imam al-Harawi said the root cause for insincerity (or shirk) is self-desire (al-hawa). Therefore no action should be done because of self-desire.
Imam al-Harawi states that there are 7 types of self-desires:-
To make oneself appear good in the hearts of others
To seek the praises of others
To avoid being blamed by others
To seek the glorification of others
To seek the wealth/money of others
To seek the services or love of others
To seek the help of others for oneself