The Messenger of Allah ﷺ said, "On the Day of Resurrection, Allah will hand over to every Muslim a Jew or a Christian and say, 'This is your ransom from the Fire.'"
قال رسول الله ﷺ: إذا كان يوم القيامة دفع الله عز وجل إلى كل مسلم يهوديا أو نصرانيا، فيقول: هذا فكاكك من النار.
Muslim narrated it in the chapter on Repentance (2767), from Abu Bakr bin Abu Shayba, who said, Abu Usama narrated to us, from Talha bin Yahya, from Abu Burda, from Abu Musa, and he related it.His saying, "your ransom from the Fire," means that you were exposed to entering the Fire, but because you chose Islam, Allah made your ransom from the Fire a Jew or a Christian (and all disbelievers in general are included with them), so that became his ransom from the Fire.