Dear @Raheel,
Welcome back to the Wefugees Community and thank you for reaching out to us again.
In general, a foreign parent of a German child could be entitled to receive a family unification visa and subsequently a residence permit according to section 28 of the German Residence Act. However, there are certain requirements to meet and it is a bit difficult to give a tailored advice here. Unfortunately, I am also not an expert in this field. I will link our dear @mbeon-fardeen and @mbeon-ruth here, maybe they can add some more details.
To be able to assess your situation better, some more information might be helpful. For instance, are you still in contact with your child's mother and is she supporting your plans? Do you have custody for the child or is the mother willing to share the custody?
All the best,
Meike