In the famous soliloquy "To be, or not to be: that is the question," Hamlet uses a metaphor to explore the idea of life and death. By comparing life to "being," he emphasizes the existential dilemma of whether it is better to exist or to cease existing. This figurative language serves to provoke deep contemplation and evoke a sense of existential angst within the audience.