You can mostly apply online if you have a residence permit to study or work in Sweden, or if you moved to a family member in Sweden. You also need to be registered with the Swedish Tax Office and have a Swedish personal number.
If you have a residence permit as an asylum seeker, if you already have a Swedish citizenship, or you are not the child’s parent, you must apply using a paper form which will take a lot longer so prepare for a long wait.
Read more at the Migration Agency. Residence permits for children who are moving to a parent in Sweden