If your qualifying child was born and died in 2021 and you do not have a Social Security number (SSN) for them, you should enter "DIED" instead of an SSN. You must attach a copy of the child's birth certificate, death certificate, or hospital records to your 2021 tax return. The document must show that your child was born alive. This procedure allows you to claim the child as a dependent on your tax return despite not having an SSN for them.
Sources:
Publication 1380
Rev. Proc. 2020-28
Publication 501 (2023)
Publication 3 (2023)
2023 Instructions for Schedule 8812 (2023)