Scripture doesn't provide a clear indication that the living actually can communicate with the dead, with some verses suggesting it may be possible and others implying it isn't (Ecclesiastes 9:5–6, 10; Isaiah 14:9–10; Luke 16:19-31).
But the Bible is very clear, though, that God forbids us from communicating with the dead. For one thing, talking to the dead in the form of praying to saints is a form of idolatry (Isaiah 42:8). It's also among the occult practices that God prohibited His people from doing (Deuteronomy 18:10–12; Leviticus 19:31; 20:6) on penalty of death (Leviticus 20:27). In one case, Saul spoke with the dead Samuel (1 Samuel 28). The result was that God judged him with death in battle (1 Chronicles 10:13–14).
The New Testament reaffirms the Old Testament view of communicating in the spirit realm with God alone (1 Timothy 2:5).
We can grieve loved ones but should never try to communicate with them.
Have you ever eaten the last cookie in a pack without realizing it was the last one? If you had known, you might have savored it more. Regret at the death of a loved one that we didn't "savor" our time with is that feeling times a trillion.
That feeling can drive us to a medium or to a seance to try communicating with that deceased loved one. Or we may seek to pray to them or talk to them. But as hard as it is to deal with grief, the reality is that they are no longer available. They are consciously aware (Luke 16:22–23), but God has set boundaries between life and death and between the physical and spiritual realms. We are never to cross those lines. He does this for our good, as we will only find true happiness and guidance through Him.
If you are experiencing great sadness right now, the best way through is reliance on God. Jesus experienced more suffering than we can imagine by taking on the sin of the world. He can “sympathize with our weaknesses” (Hebrews 4:15–16). He knows what your pain feels like. When you cry out to Him, you are not talking to a far-off, unfeeling deity, but the God-man who knows and has felt your pain.
Also, let other believers know about your sorrow (Romans 12:15; Galatians 6:2). Don't go it alone.
Even in mourning, we should honor God. That doesn’t mean to “be stoic” but to weep and wail in a way that glorifies Him as the Rock to which you cling.