To obtain a Social Security number (SSN) for your dependent who qualifies for a Social Security card while living in a foreign country, you need to contact the Social Security Administration (SSA). The IRS does not issue Social Security Numbers. You will need to use Form SS-5FS, Application For A Social Security Card, which can be obtained from and filed with the Social Security Administration.
Sources:
Publication 519 (2023)
Publication 501 (2023)
Publication 1380
Publication 504 (2023)
Publication 17 (2023)