Riyad as-Salihin, Book 12, Hadith 1322 (In-Book)

Anas (May Allah be pleased with him) reported: The Messenger of Allah said, "He who supplicates sincerely for martyrdom, it will be granted to him even though he is not killed on the battlefield."[Muslim].

وعن أنس رضي الله عنه قال‏:‏ قال رسول الله صلى الله عليه وسلم‏:‏ ‏ "‏من طلب الشهادة صادقًا أعطيها ولو لم تصبه‏" ‏ ‏(‏‏(‏رواه مسلم‏)‏‏)‏‏.‏

sunnah.com