I was emotionally connecting with the deceased, who was inside a coffin.
こんにちは!
ご質問ありがとうございます。
ご質問について、いくつか言い方が考えられますが、例えば、
I was emotionally connecting with the deceased, who was inside a coffin.
とすると、『私は棺の中にいる死者の心に[寄り添っていた](https://eikaiwa.dmm.com/uknow/questions/46008/)』となります。
役に立ちそうな単語とフレーズ
connect emotionally to 人と心がつながる
参考になれば幸いです。
I stayed close to the heart of the deceased.
I stood by them in spirit.
・Stay close to someone's heart
「(誰か)の心に寄り添う、近くに居続ける」という表現です。
・The deceased
「亡くなった方、死者」を指す、お葬式などの公的な場で使われる丁寧な言葉です。