However, as a person approaches the moment of death, the physical world has less effect on them. It could happen exactly as you describe. If you have no fear of death and are willing to remain conscious throughout the process, it could be exactly like that. Or, a sudden death could lead to such an experience. This most often happens during dream states.
Dreams occur in a nonphysical reality.
Things that happen in dreams don't physically happen, they nonphysically happen. The levels of consciousness in which dreams occur include the same levels in which people in the Afterlife exist. So, the easiest way for you to communicate from the Afterlife with a physically living person is during their dreaming. Whether the person remembers the communication or not is another matter. There are many methods a physically alive person could use to be in a state of consciousness in which you could communicate from the Afterlife.