Praise be to Allah.
Shaykh al-Islam Ibn Taymiyah was asked the following question:
I asked the Shaykh, who followed in the footsteps of the earlier generations and was the example for the later generations, the most knowledgeable man I have ever met in the east or the west, Taqiy al-Deen Abu’l-‘Abbaas Ahmad ibn Taymiyah, to point out to me what is the best righteous deed after the obligatory duties. He (may Allaah have mercy on him) replied as follows:
What you have asked about, the best deed after the obligatory duties, varies from one person to another, depending on what they are able to do and what is best at any given time. So it is not possible to give a comprehensive, detailed answer that suits everyone. But what those who have knowledge of Allaah and His commands are agreed upon is that constantly remembering Allaah (dhikr) is the best thing with which a person may occupy himself in general. Therefore the hadeeth of Abu Hurayrah narrated by Muslim says: “ ‘The mufridoon have gone ahead.’ They said, ‘O Messenger of Allaah, who are the mufridoon?’ He said, ‘Those men and women who remember Allaah much.’” And Abu Dawood narrated from Abu’l-Dardaa’ (may Allah be pleased with him) that the Prophet (peace and blessings of Allaah be upon him) said: “Shall I not tell you of the best of your deeds and that which is most pure in the sight of your Lord, that which raises you more in status and is better for you than giving gold and silver (in charity), and better than your meeting your enemy and striking their necks and they strike your necks?’ They said, ‘Yes, O Messenger of Allaah.’ He said, ‘Remembering Allaah (dhikr).’”
There is a great deal of Qur’aanic evidence to support this. The least that a person should do is to persist in reciting the adhkaar (pl. of dhikr) which have been narrated from the teacher of good and the leader of the pious (peace and blessings of Allaah be upon him), such as the adhkaar to be recited at certain times, at the beginning and end of the day, when going to bed and waking up from sleep and after the prescribed prayers; and the adhkaar to be recited on certain occasions, such as that to be said when eating and drinking, when getting dressed, when having intercourse, when entering or leaving the home, the mosque or the washroom, when it rains, when thunder is heard, and so on. Books have been compiled on this topic called ‘Aml al-Yawm wa’l-Laylah (Actions of the Day and Night). One of the best books written on this topic is the small book entitled Saheeh al-Kalim al-Tayyib, which is derived from the book by Shaykh al-Islam Ibn Taymiyah called al-Kalim al-Tayyib; this has been edited by al-‘Allaamah al-Albaani.
Then one should persist in remembering Allaah in general, the best of which is Laa ilaaha ill-Allaah.
There may be some situations where certain kinds of dhikr are preferable, such as saying Subhaana Allaah wa’l-hamdu-Lillaah wa Allaahu akbar wa laa hawla wa laa quwwata illa Billaah.
Moreover, one should realize that everything that the tongue utters or the heart imagines that may bring one closer to Allaah, such as seeking knowledge or teaching, enjoining what is good and forbidding what is evil, is a kind of dhikr or remembering Allaah. Hence the one who occupies himself in the pursuit of beneficial knowledge after performing the obligatory duties, or who joins a gathering in order to learn or teach, which Allaah and His Messenger have called fiqh or understanding, is also doing something which is one of the best forms of remembering Allaah (dhikr).
If you think about it, you will not find much difference of opinion among the earliest generation concerning what is the best of deeds. Whenever a person is confused he should pray istikhaarah as prescribed in sharee’ah, for the one who prays to Allaah asking Him for that which is best (istikhaarah) will not have any regrets. He should do that a lot, and make a lot of du’aa’, for that is the key to all goodness. He should not be hasty and say “I prayed but I did not get an answer.” He should seek out the times of special virtue, such as the end of the night, the times immediately following the prescribed prayers, the time of the adhaan, when rain is falling, and so on.