Every active thought and passive experience necessitates that one's consciousness exists, for without a mind to think or experience, there could be not a single act of cognition or sensory perception. Thus, experiencing anything, for a mind making no assumptions, is immediate, utter logical proof that one's consciousness exists. This still hinges on logic being true; there is no such thing as either mind or matter, and this includes the divine mind, having the utmost centrality since reason cannot be false, and all other things depend upon it for their truth or falsity. Nonetheless, it is self-evident to a rational person that they themself mentally exist, for, just as denying logical axioms relies on their inherent veracity, to reject or ignore or doubt one's own existence can only be done if one already exists.
Though the mind alone is what perceives stimuli like wind and trees and stones, it is separate from the external world. I cannot know, in fact, if the stars or the grass or the household items I see around me are really there outside of my consciousness as opposed to only the perceptions of their presence existing within my mind, the latter of which exists regardless. One's own body, though, can only be proven by a far more elaborate series of logical necessities than with one's consciousness [1], though the truth of the conclusion depends on the fact that consciousness is immaterial--not only is a mind without a body logically possible (this means it does not contradict logical axioms, not that human minds actually exist in this manner), and not only is a brain or individual neuron not the same as a thought, but there could also be no conceptual difference between a corpse and a conscious, living person otherwise.
Moreover, among other things, there could be no conceptual distinction between hallucinations and external, physical stimuli if mind was not immaterial, for if a hallucinated image only exists in one's mind and has no physical substance in the material world, then it cannot be physical. Hallucinations are logically possible, and much of our sensory experience might ultimately be just that despite the utter unverifiability one way or another; thus, for yet another reason, consciousness has to be nonphysical. In no way does it logically follow, although it is possible, that the mind continues to exist after the death of the body despite the intrinsic distinction between the two, whatever the initial causal relationship. In fact, even the Biblical afterlife is reserved for the eschatological time of bodily resurrection, for in the meantime, other than when something like sorcery is involved (1 Samuel 28), the dead are unconscious (Ecclesiastes 9:5, 10, Job 3:11-19, Psalm 6:5, Daniel 12:2, etc.).
If the minds of the dead no longer exist, this is distinct from lack of perception while alive, such as through extreme dissociation or dreamless sleep. Lack of active thought or broader perception, as with a dreamless slumber, does not mean that a mind does not exist, but any experience whatsoever requires that at least one mind exists: one's own. It is other minds, if they exist at all, that are either invisible to our perceptions or at least only hinted at by indirect evidences like another person's facial expressions. Under human limitations, there is no other mind one can truly know the existence or contents of. Does this fact induce loneliness, terror, or comfort? That wholly depends on an individual's subjective reaction rather than the logical truths on their own.