Although you have drifted away from righteous friends without meaning to, but you could have avoided neglecting to seek knowledge and being careless in watching and listening to haraam things. What happened to you after that may be because of the effect of those sins. We have mentioned some of those effects in our answer to question no. 23425, which we hope you will look at.
There are many women like you who have delayed marriage, but they have not done what you did. Rather they make use of their time to memorize Qur’aan, seek knowledge and call people to Allaah. This is the way in which Allaah opens hearts and puts minds at rest, and this is the way in which Allaah makes worldly matters easy for those who follow it.
Your wishing for death because you fear becoming more careless and committing more sins is a great mistake. Rather you should only wish for death when you are in a better situation than you are at present. It is up to you: you can take charge of yourself and go back to the way you were, and do better than that, in sha Allaah. But you have to be honest with yourself and hasten to go back to the way that Allaah likes and is pleased with.
Not everyone who wishes for death will get what he wants; hence we are afraid that your situation may become even worse, which is what makes the Shaytaan happy and angers the Most Merciful. You have to realize that. Your wish for death is not the solution to your problem. Rather the solution is to repent sincerely and to do that which pleases Allaah, and to make up for what you have missed of actions that are pleasing to Allaah.
Perhaps you know that what has happened to you and what Allaah has decreed for you may be better for you, if you come back to Allaah, because you will regret what has happened and you will do more acts of obedience and worship, and Allaah will turn the bad deeds that have been recorded against you into good deeds. This is the bounty of Allaah towards His slaves.
Shaykh al-Islam Ibn Taymiyah said:
Whoever thinks that a person who has committed sin and then repents will be lacking is making a great mistake, for the condemnation and punishment that may befall the sinner do not affect the one who repents from sin at all. If he hastens to repent from sin then nothing will affect him, but if he delays repentance then he may be affected by some condemnation and punishment during the period between committing sin and repenting.
Majmoo’ al-Fataawa, 10/309.
And he said:
But a person may do something haraam and then repent, and that is good for him if he repents from it, and by repenting he may become humble and soft-hearted, and more devoted to Allaah. Sins may serve an interest if one repents from them, because if a person does not commit sin he may become arrogant, filled with self-admiration and hard-hearted, but if he commits sin, that humbles him and softens his heart because of his repentance.
Majmoo’ al-Fataawa, 14/474
See also the answer to question no. 21677, which describes how to treat anxiety and depression.
And Allaah is the Guide to the straight path.