The Prophet ﷺ said, "Whoever sincerely asks Allah for martyrdom from his heart, Allah will raise him to the ranks of the martyrs, even if he dies in his bed."
حدثنا محمد بن سهل بن عسكر البغدادي حدثنا القاسم بن كثير المصري حدثنا عبد الرحمن بن شريح أنه سمع
عن النبي ﷺ قال من سأل الله الشهادة من قلبه صادقا بلغه الله منازل الشهداء وإن مات على فراشه
Muslim also narrated it, in the Book of Leadership, chapter on the desirability of seeking martyrdom for the sake of Allah the Exalted, hadith no. 1909, from the hadith of Abdul-Rahman bin Shurayh, with this same wording.There is also a report on this subject from Muaz bin Jabal [see hadith 1654].