Praise be to Allah, and peace and blessings be upon the Messenger of Allah. To proceed:
Affliction is not evidence that Allah is displeased with a person or that He has not accepted his repentance. Allah may test His servant for many reasons: as a test, as an expiation for sins, or to raise his rank. The prophets and righteous people were among those who were most severely tested.
When facing hardship, a servant is required to think well of his Lord, repent to Him, acknowledge his shortcomings, seek His help, as Yunus (Jonah), peace be upon him, said:
﴿There is no deity except You; glory be to You. Indeed, I was among the wrongdoers.﴾
So Allah answered his supplication and saved him from distress.
The delay in the response to a supplication does not mean that Allah has not accepted you. Allah may reserve greater good for His servant or avert harm from him, and Allah knows best what is beneficial for him. Allah تعالى said:
﴿Do not despair of the mercy of Allah.﴾
As for suicide, it is not a solution. Rather, it is among the greatest dangers. A person does not escape from the pain of this world into comfort; rather, he moves on to the Hereafter. Therefore, one must be patient, turn to Allah, and not surrender to despair. There is a severe warning concerning the one who kills himself.
So turn to Allah, think well of Him, persist in supplication, take permissible means, and seek the help of trustworthy and righteous people in dealing with your problems. This worldly life is constantly changing, and hardship does not last. Allah تعالى says:
﴿For indeed, with hardship comes ease. Indeed, with hardship comes ease.﴾
In conclusion: Do not make affliction a sign that Allah does not want you. Rather, remain steadfast, repent, think well of Allah, do not despair of His mercy, and never make suicide an option, no matter how severe the hardships become.
And Allah knows best.