Let no one be found among you who consigns his son or daughter to the fire, or who is an augur, a soothsayer, a diviner, a sorcerer, one who casts spells, or one who consults ghosts or familiar spirits, or one who inquires of the dead. - Devarim (Deuteronomy) 18:10-11
Speaking to the dead is forbidden. You're not allowed to attempt such things.
This being said, is there a Rabbinically defined line as to what constitutes a sinful exercise in the dark arts vs innocent grief?
Some people speak to their dead relatives. They don't literally light candles, draw a pentagram, and conduct some exercise in the dark arts. They may just speak out loud or speak in their minds during moments of grief or hardship.
"Mom, I really hope you think I'm doing the right thing. I wish you were here to help me right now."
Does that count as communicating with the dead or is there a specific definition for what constitutes this sort of activity?