Book 1 of Melachim (Kings) chapter 19 verses 3 -4 it says that Elijah Prays for death.
And he saw, and he arose and went for his life, and he came to Beer Sheba which belonged to Judah. And he left his servant there.
וַיַּ֗רְא וַיָּ֙קָם֙ וַיֵּ֣לֶךְ אֶל־נַפְשׁ֔וֹ וַיָּ֕בֹא בְּאֵ֥ר שֶׁ֖בַע אֲשֶׁ֣ר לִֽיהוּדָ֑ה וַיַּנַּ֥ח אֶֽת־נַעֲר֖וֹ שָֽׁם
He went to the desert, a distance of one day's travel, and he came and sat under a juniper and requested that his soul die, He said, "Enough, now Lord take my soul as I am not better than my forefathers."
וְהֽוּא־הָלַ֚ךְ בַּמִּדְבָּר֙ דֶּ֣רֶךְ י֔וֹם וַיָּבֹ֕א וַיֵּ֕שֶׁב תַּ֖חַת רֹ֣תֶם אֶחָ֑ד (כתיב אֶחָ֑ת) וַיִּשְׁאַ֚ל אֶת־נַפְשׁוֹ֙ לָמ֔וּת וַיֹּ֣אמֶר | רַ֗ב עַתָּ֚ה יְהֹוָה֙ קַ֣ח נַפְשִׁ֔י כִּֽי־לֹא־ט֥וֹב אָנֹכִ֖י מֵאֲבֹתָֽי
What was Elijah confused about and why did he pray for death?