‘Giving up the ghost’ can be literal as well as metaphysical, can’t it?
I’m watching my mum do it as she approaches her end.