I want to get closer to Allah. What can i continuously do for 40days to get closer to Allah . I want my heart to become pure from spiritual diseases like arrogance, envy etc and I want my heart to become free from love of this world. It is said when we do an act for 40days it becomes our habit .What can i do so that Allah raises me spiritually

This process never end it's jahad ba nafs that need continues struggle, and it's start from small things then lead to higher act.
1st do your wajibaat and stay away from all haram deeds, astagfar daily after fajar, read dua ahad after fajar prayers, rest live normal life because we are born to be in society.