Thank you for sharing your situation with the Wefugee Community!
In general, you might have the option to apply for a residence permit to be able to take care of your German child ("Aufenthaltserlaubnis zur Personensorge"). This topic was discussed a few times already on this platform. Please check, for example, this thread for more details.
However, to meet the requirements it will be essential to officially acknowledge the paternity (since you and the mother are not married) and declare the custody for the child.
Therefore, you will need to see the authorities sooner or later. I would highly recommend you to seek some legal advice either from a lawyer or a migration counselling office. Please let us know if you need support in finding one close to your place.
Also do not hesitate to get back to us with any further questions!
All the best for you and your family,