I'll share more than one stage.
I used to believe in an afterlife, a god and other things through Islam because first these ideas were introduced, taught and built into me through time. I liked them and continued to do so as they gave me things like hope, something to look up to, a promise of compensation for the injustices that i could perceive in life (not particularly in mine, but rather in other people's lives), warmth etc...
It made perfect sense to me given my criteria for what made sense at the time. In time, my criteria started to change as i started to change. I became more demanding and i also became more worried about the possibility of being wrong. The idea of dying thinking that there is an afterlife when there might be none started to haunt me, despite realizing that then, when i'm dead, it wouldn't actually bother me (assuming i'd be nothing more than just a dead corpse. IOW unconscious).
This started because i had developed some objections to my religion and as such i started to lose my confidence in my position and in my religion. In some of those cases the objections were severe. It wasn't the first time i had objections but where the first time i had ones that i could not address in any way that i'd perceive as reasonable. They then developed into disagreements.
So, when that happened, i had no reason left to continue holding on to beliefs that i used to actually believe, and thus decided to step back and stand in as much neutrality as possible to allow myself what is hopefully a relatively free perspective in attempt to have a more unbiased look at the world, various religions/philosophies, and people. I figured this would also be the best for me now for many reasons. As it falls in line with many aspects of my personality, and so would cause me more comfort, compared to my state when i was following a religion that i found disagreeable in many regards.
I still hope that there's more than just this life, and hope that there could be any kind of what i perceive as justice to fix what i see as broken, but i simply feel better now knowing that i'm attempting to live my life putting in mind both possibilities with equal (or almost equal) importance or emphasis. Whether there's more to this than i see, and whether if what i see is all there is.