Hang up one’s hat

To leave a job (usually after a long career).

The man decided to hang up his hat after forty years at his job.