Dear @Waqarvicky,
Welcome back to the Wefugees Community and thank you for reaching out to us again.
I am sorry to hear about your struggles - did you consider to contact a couple counselling center (marriage guidance)? Let us know if you need support in finding one in your area.
Regarding the permanent residence permit (Niederlassungserlaubnis): This is not dependent on your marriage/your spouse. It will not expire after a divorce (usually only, if you leave Germany for more than 6 months).
For more information on divorce in Germany you may check Handbook Germany's website which provides content in various languages.
I hope this helps and please don't hesitate to get back to us with any further questions.
All the best,
Meike