Hello brother, I fear the afterlife, the time when I'll be laying in my grave, and it scares me whenever I think of it, especially at night. But when the Sun is up I start to forget about it. and another thing is, I am afraid it is the fear that leads me to be a good muslim. But I want it to be out of love to the God rather than out of fear. I want to live Islam in a harmony and to fix my trust in God's Mercy. Yet I've sinned, and still find hard to leave some bad habits. What should I do?
There is nothing wrong with worshiping God out of fear or desire. The Quran says:
And do not corrupt on earth after its reformation, and pray to Him out of fear and desire. God’s mercy is close to the doers of good. (The Quran, verse 7:56)
Those who think that God should only be served out of love are naively choosing one of the God’s attributes as if it is superior to His other attributes. God wants to be worshiped for all of His attributes. When you ask Him to give you something because you desire it, you are pleasing His attributes of power and generosity. When you worship Him out of fear, you are pleasing His attributes of power and majesty. God never tells us that some of His attributes are superior to others. We must take all of His attributes into consideration when we interact with Him.
A person who only relies on God’s attributes of love and forgiveness are in reality trying to set up a false god; they are creating their own god by picking and choosing some of His attributes over others. To truly know God, the real God, is to fear Him, to desire His generosity and mercy, to fear His retribution, and to want to be loved by Him.
Being a good Muslim is a daily struggle. No matter how faithful and spiritual you felt the day before, the next day you have to start the struggle from scratch. You will continue sinning as long as you live. The point is to always go back to God, ask Him for His forgiveness and guidance, and work to better yourself.
As for fearing the afterlife, there is nothing wrong with this unless it prevents you from enjoying a good and productive life. We are supposed to fear it. Any Muslim who does not fear it, who thinks they are now in such a good place spiritually that they will be safe if they die, has got it wrong and has become proud and has lost their true understanding of God. We are never safe as long as we live, and this feeling should always make us seek safety in God. This world is a testing hall. The only true safety we achieve is when we get the results in the afterlife and we are told that we passed the test.