Praise be to Allah.
Habit is a neutral concept, so it is a good thing if a person gets used to doing good and to being steadfast when doing it, without finding it burdensome. It was narrated in the hadith: “Doing good is a habit [that one may acquire easily] and evil is stubbornness [and man persists in it only out of stubbornness].” Narrated by Ibn Maajah (221) and by Ibn Hibbaan in his Saheeh (310).
It was narrated from ‘Aa’ishah that she said: The Messenger of Allah (blessings and peace of Allah be upon him) had a reed mat with which he used to make a booth at night and pray in it, and the people started to follow his prayer, and he used to spread (that mat) out during the day. One night they gathered and he said: “O people, you should only do deeds that you are able for, for Allah does not grow weary but you do. The most beloved of deeds to Allah is that which is done persistently, even if it is little.” And if the family of Muhammad started to do something, they would persist in it. Narrated by al-Bukhaari (5861) and Muslim (782).
As Abu’t-Tayyib said: Each person will gain of his life that which becomes a habit for him.
It is well-known that one of the greatest means of a person becoming steadfast in his journey towards Allah is having acts of worship to which he commits himself, remains steadfast in doing them, and becomes accustomed to doing them, and he does not neglect them, become heedless concerning them or feel too lazy to do them. This was always the practice of the Prophet (blessings and peace of Allah be upon him); in other words, he would do them constantly and persistently. And if his family did something, they would persist in it.
With regard to habit in the sense that a person does not have presence of mind when doing an act of worship, so he does it automatically, with no spirit or focus, that is something very dangerous, and he should be concerned about that.
The reward for worship is connected to presence of mind and humility whilst doing it, as Allah, may He be glorified, says (interpretation of the meaning):
“Certainly will the believers have succeeded:
They who are during their prayer humbly submissive”
It is very important that the heart should be focused when doing an act of worship, and not be distracted from it.
Shaykh Ibn Baaz (may Allah have mercy on him) was asked:
I have read some advice in a book which says: do not make worship a habit. How can a Muslim make worship of Allah truly for Allah, and not a mere habit? May Allah reward you with good.
What is meant is: do not do the prayer as a habit; pray as an act of worship so that you may draw closer to Allah thereby, and not because it is a habit that you have got used to. If you pray Duha, then pray it for the purpose of drawing closer to Allah, not because it is a habit. By the same token, if you pray tahajjud at night, pray it because it is an act of worship and obedience, not because it is merely a habit or because your father or mother used to do it.
Among the things that may help one to attain focus of mind when doing acts of worship are the following:
1. Variation in acts of worship. The individual should do a variety of acts of worship, including prayer, reading Qur’an, dhikr, giving charity, honouring his parents, upholding ties of kinship, visiting the sick and attending funerals. By the mercy and grace of Allah, acts of worship are many and varied.
2. Persistence in keeping the intention in mind when doing the acts of worship.
Ibn al-Qayyim said in ‘Umdat as-Saabireen (60-65):
… Being persistent whilst doing the good deed, so the person should persist in warding off any shortcomings or negligence in the action. He should persist in keeping his intention in mind and continue to be focused when standing before his Lord, and not be absent-minded when carrying out His command. What matters is not only doing what is enjoined; rather what matters above all is not forgetting the One Who enjoined it when doing what He enjoined. Rather he should persist in remembering Him whilst carrying out His command.
This is the worship of the true and sincere slaves of Allah. It requires patience and perseverance in order to be able to do acts of worship in the proper manner, by performing the act with all of its essential, obligatory and Sunnah parts. It also requires persevering in remembering the One Whom he is worshipping when doing that act of worship, and not letting himself be distracted from that by his worship. So his presence of mind with Allah should not distract him from carrying out the physical actions of the act of worship properly, and focusing on doing the physical actions in the proper manner should not distract him from presence of mind when standing before Allah, may He be glorified. End quote.
3. Striving hard in du‘aa’ (supplication).
This is one of the greatest means that help one to keep in mind the fact that Allah is with him and is helping His slave.
4. Not giving up acts of worship.
That is one of the means by which the Shaytaan discourages a person from doing acts of worship, on the grounds that he is not able to focus. So let the believer be aware of that, and let him continue to do the acts of worship.
5. Preparing oneself for a particular act of worship and getting ready for it, and keeping away from anything that may distract him from it.
It was narrated from ‘Aa’ishah that the Messenger of Allah (blessings and peace of Allah be upon him) said: “Do not pray when food has been served and do not pray when resisting the urge to relieved oneself.” Narrated by Abu Dawood (89).
And Allah knows best.