If the child’s parents are citizens of a non-EU/EEA country, you have to apply for a residence permit for your child.
If one of you has a residence permit in Sweden and the other has applied for asylum, you can apply for a residence permit for your child. If the child is in need of protection, you can apply for asylum for your child.
If one of the child’s parents is an EU/EEA citizen and has a right of residence in Sweden, and your child is also an EU/EEA citizen, then they automatically have a right of residence. In that case, you do not need to contact the Swedish Migration Agency. For information about your child’s population registration, contact the Swedish Tax Agency.