Dear Muhammad khalid,
Welcome back to the Wefugees Community and thank you for sharing your question.
Talking about the impact a seperation of you as parents potentially has on the relationship and access to your child, this is usually highly dependent on the individual situation. In case you and the child's mother can not find an agreement which is satisfying and good for everyone involved, lawyers on both sides may eventually need bo be cunsulted.
We discussed the topic of applying for a residence permit as father of a child holding a residence permit (or is your child German?) already a few times on this platform. You may want to see this thread, for instance, for more details.
In any case, you will need to be officially registered as father of the child and better also share the custody respectively.
Please don't hesitate to get back to us with any further questions.
All the best,