Praise be to Allah.
Adoption of children is of two types, forbidden and not forbidden.
The forbidden type means adopting a child in the sense that the child is considered to be the child of the adopting parent and subject to the rulings on children. This is not permitted. Allah nullified it in the Qur’aan when He said (interpretation of the meaning):
“…nor has He made your adopted sons your real sons…” [al-Ahzaab 33:4]
The kind which is prescribed and may be mustahabb means being kind towards the child and giving him a righteous religious upbringing and sound direction, teaching him that which will benefit him in this world and the next. But it is not permitted to hand a child over except to one who is known to be trustworthy, religiously-committed and of good character, who will take care of the child’s interests. He should also be a local resident, so that he will not take the child away to a country where his presence may be a cause for his religious commitment being lost in the future. If these conditions are met in the case of both the child and the adopting parent, then it is OK to hand over a foundling whose parentage is not known. May Allah preserve you