The most famos metaphor in Hamlet is his "To be or not to be speech" in Act 3 sc 1.
"To die: to sleep; / No more; and by a sleep to say we end / The heart-ache and the thousand natural shocks / That flesh is heir to."
Sleep becomes a metaphor for death.