Ayesha reported,

The Messenger of Allah ﷺ was invited to the funeral of a young boy from the Ansar.I said, "Messenger of Allah, blessed is this child, a sparrow among the sparrows of Paradise. He did no evil and never lived to encounter it."He replied, "Or it could be otherwise, Ayesha. Allah created people destined for Paradise, He created them for it while they were still in the loins of their fathers, and He created people destined for the Fire, He created them for it while they were still in the loins of their fathers."

Muslim 6768

Sahih

حدثنا أبو بكر بن أبي شيبة حدثنا وكيع عن طلحة بن يحيى عن عمته عائشة بنت طلحة

عن عائشة أم المؤمنين قالت

دعي رسول الله ﷺ إلى جنازة صبي من الأنصار فقلت يا رسول الله طوبى لهذا عصفور من عصافير الجنة لم يعمل السوء ولم يدركه قال أو غير ذلك يا عائشة إن الله خلق للجنة أهلا خلقهم لها وهم في أصلاب آبائهم وخلق للنار أهلا خلقهم لها وهم في أصلاب آبائهم

مسلم 6768صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Decree
Chapter
Meaning of "every child is born upon fitrah" and the ruling on the death of children of disbelievers and children of Muslims
Numbering
Darussalam 6768
Muslim 6768