Thanks for asking a question on www.thisisyourbible.com
This phrase occurs in the book of Jonah.
Jonah 4:3 Therefore now, O LORD, please take my life from me, for it is better for me to die than to live.”
Jonah is in extreme distress because of the blistering heat of the sun and the fact that his preaching to the people of Nineveh resulted in their repentance. Nineveh, capital of the Assyrian Empire was the mortal enemy of the Israel and Jonah knew that, because of Israel's wickedness, God would use the Assyrians to destroy Israel. He make the statement because of his extreme physical distress and depression because the Assyrians would not be destroyed by God and would indeed destroy his people, Israel. In his depression, he wished to die. However, God teaches Jonah a lesson in Divine compassion which has resonated down the ages to our own time.
I hope you have found this helpful.