feather
© Unknown
In a survey article at Business Insider, Erin Heger points to several studies that shed light on what happens when we die.

She starts by referencing Julia A. Nicholson's recent account of her own NDE when she was 18, as a result of a near-fatal car crash:
"I didn't feel any pain but I heard voices around me. I could then hear my sister screaming, "She's dead, my sister is dead." So I believed that I must have died. I remember my sister, Allan, and John saying, "If you can hear us, move, or touch something," but I couldn't move at all.

"After I started to regain consciousness, I remember seeing the faces of the people that I loved flashing before my eyes. Every single face that appeared in my memory had something in common: they were the people that I loved and deeply cared about. I thought: I love all of these people, and I never got to tell them."

- JULIA A. NICHOLSON, "'A NEAR DEATH EXPERIENCE LED ME ON A PATH I NEVER EXPECTED'" AT NEWSWEEK - JANUARY 7, 2023
Nicholson survived to tell the story, of course, and — looking back — she reflects:
"Having a near-death experience caused me to have a sense of urgency to get things done, not knowing if my next minute alive would be my last. It also allowed me to live my life to the fullest, not worrying about other people's opinions or the fear of 'failure.'"
Near-death experiences are commonly life-changing events that provide evidence that the human mind is not simply a function of the body and appears, at times, to operate independently of it.

More Information Is Coming In

Heger also points to a 2016 case where an 87-year-old man was having his brain scanned when he died — unexpectedly — of a heart attack. So, in a rare event, the scan recorded his unanticipated final brain activity:
"Just before and after the heart stopped working, we saw changes in a specific band of neural oscillations, so-called gamma oscillations, but also in others such as delta, theta, alpha, and beta oscillations."

Brain oscillations (more commonly known as 'brain waves') are patterns of rhythmic brain activity normally present in living human brains. The different types of oscillations, including gamma, are involved in high-cognitive functions, such as concentrating, dreaming, meditation, memory retrieval, information processing, and conscious perception, just like those associated with memory flashbacks.

"Through generating oscillations involved in memory retrieval, the brain may be playing a last recall of important life events just before we die, similar to the ones reported in near-death experiences," Zemmar speculated. "These findings challenge our understanding of when exactly life ends and generate important subsequent questions, such as those related to the timing of organ donation."

- MARYAM CLARK, "A REPLAY OF LIFE: WHAT HAPPENS IN OUR BRAIN WHEN WE DIE?" AT FRONTIERS IN SCIENCE NEWS (FEBRUARY 22, 2022)
In other words, the brain activity recorded was consistent with what many people recounting near-death experiences report: A sense of a review of their lives. The paper is open access.

In Other Interesting Results

Of course, that's just one case, in which the patient was not resuscitated. But it captured neurological information that is not usually available. Meanwhile, asking people to recall near death experiences has also produced interesting results, according to NDE researcher and psychiatrist Bruce Greyson, author of After (2021):
When people recall an NDE, the brain "shows increased activity in many different parts," Greyson said, "such as those associated with memory, vision, hearing, and emotion."

In particular, the temporal lobe, which is responsible for helping process sound and encode memories, is thought to be associated with out-of-body experiences and memory flashbacks during NDEs, said Dr. David San Filippo, an associate professor at National Louis University and a near-death experience researcher.
- ERIN HEGER, "WHAT HAPPENS TO THE HUMAN BRAIN DURING A NEAR-DEATH EXPERIENCE THAT CAN TRIGGER VIVID MEMORIES AND BIZARRE SPIRITUAL ENCOUNTERS" AT BUSINESS INSIDER (JANUARY 18, 2023) THE PAPER IS OPEN ACCESS
San Filippo noted that the generally positive experience associated with NDEs "may be the brain's way of gradually preparing the body for death by inducing feelings of euphoria and pain relief." That doesn't account for how the brain "knows" that the body is dying or why it would respond by inducing euphoria in order to make the body feel better (as opposed to mounting a survival attempt). Overall, more research seems well justified.
About the Author:
Denyse O'Leary is a freelance journalist based in Victoria, Canada. Specializing in faith and science issues, she has published two books on the topic: Faith@Science and By Design or by Chance? She has written for publications such as The Toronto Star, The Globe & Mail, and Canadian Living. She is co-author, with neuroscientist Mario Beauregard, of The Spiritual Brain: A Neuroscientist's Case for the Existence of the Soul.