
Give up the ghost
Literal End
Refers to the actual end of life or function, often used for inanimate objects or humor. 
Humorous Tone
It can add a light-hearted or humorous spin when talking about something ceasing to function. 
Non-living Things
More commonly used to describe machines or devices failing, not people dying. 