Intention is an alchemic prescription that can turn base dirt into noble gold. The hadith in Sahih Bukhari says "All actions depends upon intentions."
It is sometimes interpreted to mean that good intentions justify bad deeds too and turn sins meritorious. This is entirely wrong. Sin is always a sin no matter how noble the intention may be. For instance if someone breaks into a house to steal with the intention of giving away as alms whatever he would steal would be a thief deserving the prescribed punishment. His good intentions would not earn him any merit nor would his sin be pardoned.
What this hadith means is as follows:
1. A good deed earns merit only if done with right intention. For instance prayer would earn merit only when one prays only for Divine pleasure; if one prays to impress others, then, instead of earning merit, it would earn punishment.
2. The second interpretation which is germane to the present discussion is that all lawful deeds actually earn neither merit nor punishment, but if these are done with good intent, they become acts of worship and earn merit. For instance eating is lawful; but if one eats with the intention that food shall give him energy and that energy he shall spend in the service of Allah, the act of eating would earn merit. Similarly if one eats with the intent that his physical body too has its rights and dues which include nourishment through eating or if one eats with the intent of getting pleasure and taste and of thanking Allah for these, the eating become an act of merit.
There is no lawful deed of life, which if done with good intent, does not become act of merit.
A few instances shall elucidate the point further:
(a) Honest earning, whether by trade or service or industry or agriculture, if done with the intent of rightly fulfilling the duties enjoined by Allah toward oneself and one's family, would become an act of merit. Then if one further intends to spend whatever he may save after fulfilling the needs of himself and his family in helping the poor and in other similar good deeds, he would earn further merit.
(b) When a person engaged in learning intends to serve the humanity through his knowledge he would go on earning merit as long as he remains engaged in acquisition of knowledge. For instance a student of religion may decide to propagate the faith, a medical student to alleviate human suffering due to disease, an engineering student to serve his people through his specialised knowledge etc. all these acts would become acts of merit because of the intention which motivates the doer.
(c) A man, knowing that sustenance and subsistence is the responsibility of Allah which He shall fulfil without fail, engages is a particular profession or vocation with a view to serve humanity, his profession would earn him merit.
For instance if someone enters the medical profession consciously choosing it form among other professions in order to cure the sick, he would earn merit even if he charges for his services. Such a man would not hesitate to provide free treatment for the poor and the destitute.
A cloth merchant who enters this profession to provide clothes to people because clothing onself is a religious duty, would also earn merit.
Similarly a government servant, motivated by a desire to serve the common man and fulfil his needs, would earn merit. Thus every profession, becomes meritorious, provided the intention is right.
(c) If one dresses in finery not to show off his status or wealth, but to afford pleasure to others, it is an act of merit.
(d) If one treats his children with love because it is a sunnah of our etemally blessed Prophet, it earns him merit.
(c) If one does the household chores because this too is a sunnah as our etemally blessed Prophet helped in the housework, it merits rewards in the Afterlife.
(f) Loving conversation with wife and children is a sunnah and the eternally blessed Prophet has so ordained, hence such an act is also meritorious if done to follow the sunnah.
(g) Hospitality to guests, if shown in pursuance of sunnah is an act of merit.
(h) Planting a sapling or plant in the house so that it may one day be of use of some man or animal and please the onlooker would be a good deed.
(i) Writing a beautiful and legible hand to make it easy for the reader to read is an act of merit.
(j) If a woman dresses herself in beautiful raiment and wears ornaments and adorns herself to please her husband and if a man remains clean and neat to please his wife, both are good deeds.
(k) If permissible recreation is indulged in to the extent needed to prepare oneself for duties it is a meritorious act.
(1) If a watch is kept to know prayer timings and to realize the value of time which is intended to be spent in good deeds, it is an act that earns merit.
There are a few common examples from everyday life which can earn much merit for the doer. Imam Ghazali has rightly observed in his Ihya'-al'ulum that there is no lawful action in human life which, if done with the right intent, cannot be changed into an act of merit. Even if husband and wife give mutual pleasure to each other, each with the intent of giving the other his or her due and making them pure this too would give them merit.
-Taken from 'Easy Good Deeds' by Mufti Taqi Usmani DB.