As-Salaam alaikum,
In ayat 31 of Surat Ali-Imran of the Holy Qur'an (3:31), we read it where Allah Ta'ala says:--

"Say [O Muhammad], if you love Allah, follow me:
Allah will love you and forgive you your sins."

Here we clearly see that following... imitating Prophet Muhammad, Sallallahu alaihi Wasallam, is the key to living a life that pleases Allah and thus will be rewarded by being drawn into the love of Allah. Muhammad alaihi salaat was salaam is al-insan al-kamil, the perfect human being, so as we seek perfection, we should follow his example in all things.

The first step in following the Prophet is to align the human will with the will of Allah Ta'ala by obeying all the Commands and Prohibitions of Allah. The second step is through additional voluntary acts of service, worship and love... as summarized in a saying of Allah on the lips of the Prophet, Sallallahu alaihi Wasallam (Hadith Qudsi):--

"When My servant approaches Me through additional voluntary good works,
then I love him. When I love him, I am the hearing with which he hears, the
eye with which he sees, the hand with which he grasps, and the foot with which
he walks.."
(Bukahri, Hadith No. 6502)

This is the state of selflessness.