give up the ghost
US /ɡɪv ʌp ðə ɡoʊst/
UK /ɡɪv ʌp ðə ɡoʊst/

1.
to die
:
•
After a long illness, the old man finally gave up the ghost.
•
The ancient king gave up the ghost in his sleep.
2.
to stop working or functioning
:
•
My old car finally gave up the ghost on the highway.
•
The ancient computer gave up the ghost after years of loyal service.