The way to draw closer to Allah has been explained to us in the clearest terms by Him, may He be glorified and exalted, in His Book, and He sent to us His Prophet Muhammad (blessings and peace of Allah be upon him), who did not omit anything good but he told us about it and he did not omit anything bad but he warned us against it. We will quote here just one of the beneficial and comprehensive hadiths in which the Prophet (blessings and peace of Allah be upon him) explained the way that will bring us closer to Allah, may He be glorified, in the most concise and clearest terms. Al-Bukhaari (6502) narrated that Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Allah says: ‘Whoever takes a close friend of Mine as an enemy, I declare war on him. My slave does not draw closer to Me by anything more beloved to Me than that which I have made obligatory upon him, and My slave continues to draw closer to Me by doing naafil (supererogatory) deeds until I love him, and if I love him I will be his hearing with which he hears, his vision with which he sees, his hand with which he strikes and his foot with which he walks. If he were to ask of Me, I would surely give to him; if he were to seek refuge with Me, I would surely grant him refuge. I do not hesitate about anything that I want to do as I hesitate to take the soul of a believer, for he hates death and I hate to hurt him.” This hadith clearly and concisely highlights the way to become a close friend of Allah, may He be exalted, for the one who wants to be one of His close friends.
Al-Haafiz Ibn Rajab al-Hanbali (may Allah have mercy on him) said in Jaami‘ al-‘Uloom wa’l-Hikam (2/335): This hadith mentions that which will bring us closer to Him. The basic meaning of wilaayah (close friendship) is nearness or closeness, and the basic meaning of ‘adaawah (enmity) is distance or being far away. So the close friends of Allah are those who draw close to Him by means of that which brings them closer to Him.
This hadith highlights the way that brings one closer to Allah, may He be exalted. All the believer has to do is reflect deeply upon this hadith and understand it properly, then follow that by acting upon what it says. After that, by Allah’s leave, he will be on his way to becoming a close friend of Allah, may He be exalted, and drawing closer to Him, commensurate with the deeds he does, seeking thereby the Countenance of Allah, may He be exalted, and following the Sunnah of His Messenger (blessings and peace of Allah be upon him). Explaining the content of this hadith, al-Haafiz Ibn Rajab (may Allah have mercy on him) said elsewhere in his book Jaami‘ al-‘Uloom wa’l-Hikam: His close friends who are near to Him may be divided into two categories, the first of which is those who draw near to Him by doing that which is enjoined, which includes doing obligatory duties and avoiding things which are prohibited, because all of that comes under the heading of what Allah has enjoined upon His slaves. The second category is those who draw nearer to Him, after doing obligatory duties, by doing naafil (supererogatory) deeds.
So the Muslim must strive hard, first of all, to establish the obligatory duties that Allah has enjoined upon him, such as the five daily prayers, which are the most important of the practical obligatory duties, as well as giving zakaah, fasting Ramadan, performing the pilgrimage to the Ka‘bah if he is able to do so, and all the other obligatory practical duties, such as honouring one’s parents, upholding ties of kinship, fulfilling the rights of one’s wife and children, enjoining what is right and forbidding what is wrong, to the best of one’s ability, and other significant acts of worship which only draw one closer to Allah. One must also do acts of worship of the heart, such as being sincere to Allah, may He be exalted, alone, and loving Him, loving His Messenger and His law, loving the believers, putting one’s trust in Allah, fearing Him, and other acts of worship of the heart that have been enjoined.
He must also strive hard to fulfil the rights of Allah, may He be exalted, with regard to the second type of obligatory duty, which is the obligation to refrain from that which Allah has instructed us to refrain from. This includes refraining from zina (unlawful sex), riba (usury, interest), alcohol, stealing, wrongdoing, backbiting, malicious gossip and other prohibited actions. If he does do any of these things, then he must hasten to repent and mend his ways.
With regard to all these matters, one needs to acquire Islamic knowledge in order to worship Allah with insight and understanding.
Moreover, after that the believer must do a lot of supererogatory actions, by means of which he may attain a lofty status before Allah and attain the love of Allah, may He be exalted, as mentioned above in the hadith.
There are many of these supererogatory actions; the Muslim should start with the most important of them, then the next most important. The best and most significant of them is acquiring Islamic knowledge and teaching it to people.
Another example is the confirmed naafil (supererogatory) acts of worship, such as the regular Sunnah prayers (as-sunan ar-rawaatib), qiyaam al-layl (voluntary prayers at night), and Witr prayer.
That also includes remembering Allah, may He be exalted, a great deal (dhikr), and doing acts of charity. One of the things that will help the Muslim to do that is to organise his time by night and day. So he should allocate time for obligatory duties and time for supererogatory deeds. He can also help himself to attain that by attending the gatherings of the righteous and good people. May Allah help us and you to do that which He loves and is pleased with.
And Allah knows best.