I'm an atheist and believe in an afterlife . . . more appropriately referred to as death. Life beyond the present moment is inherently uncertain but the past informs us of the benefits of being prepared for the most likely outcome, that as long as we are alive the quality our experience of the next moment and the next depends on our understanding of the requirements of life and that which makes it worth living, knowing what is possible and what is best. Knowing what is possible is essential to the process of determining what is best and entails a knowledge and understanding of what life is, its requirements, demands and limitations.
Life is the self-sustaining, self-generating process of an organism endowed with the means to accomplish these essential tasks. When the organism ceases to function and is no longer capable of performing these essential tasks the organism dies and life the self-sustaining, self-generating process of the organism ceases. While most people seem to implicitly understanding that, a explicit understanding is essential to going to the next level, an understanding of the mutually supportive and interdependent nature of consciousness.
Consciousness is a result of the means by which an organism becomes aware of its surrounding and ultimately of its self and the nature of its own existence. It involves and relies on organs capable of sensing different aspects of those surroundings, of interpreting and integrating those sensations into perceptual data it can then use to find what it needs to maintain and promote the existence of the organism. That there is no purpose for consciousness beyond the need of an organism to be aware to survive is beside the point. Without the organism that provides the highly evolved complex physical structure in which and with which to perform the processes required for consciousness, there can be no consciousness, no awareness, no sensation, nada, zip, you're dead.