Ayesha reported,

A child passed away, and I said, "Blessed is he, a sparrow among the sparrows of Paradise."The Messenger of Allah ﷺ said, "Do you not know that Allah created Paradise and created Hell, and created for this one its inhabitants and for that one its inhabitants?"In another narration, the Messenger of Allah ﷺ was called to the funeral of a child from the Ansar. I said, "Messenger of Allah, blessed is this one, a sparrow among the sparrows of Paradise. He did no evil, nor did evil reach him."He replied, "Or otherwise, Ayesha. Indeed, Allah created people for Paradise, He created them for it while they were still in the loins of their fathers, and He created people for Hell, He created them for it while they were still in the loins of their fathers."

Azami 3765

Sahih

عن عائشة قالت

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

الأعظمي 3765صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Children of Muslims and polytheists
Section
Children of Muslims
Numbering
Jami al-Kamil 3765 (2nd edition)
Azami 3765