Don't resign that will just make things worse. Fix the problem(s). The problem is you are so busy worrying, you aren't doing any fixing. (Yes I know some problems can't be fixed like having a child dying, but you can seek professional help in dealing with those kinds of problems.)
Start by telling your boss you have some personal problems and need to take some time off. Then take off at least a week and find resources to help with the problem in that time off. Depending on what the problem(s) is(are), you might need to use your time off to do such things as:
- Move out of your current living quarters and file for divorce
- Seek treatment for depression
- Work out a payment plan with the people you owe money to
- Consult a lawyer
- Get caught up on sleep so you can think straight
- Have a serious talk with the people in your family who have problems
and find them the help they need
- Visit your dying father, etc.
After a week off, if you spend it productively seeking solutions to your personal problems, you will probably find it easier to concentrate at work. If you think you won't do any steps in the time off, then ask someone to help you out by setting up the appointments and/or driving you there.
Next you need to learn the skill of compartmentalizing. Once you walk into work, you need to put your personal problems in a box and not open that box until you leave. You need to turn off your cell phone. You need to stop checking social media and you need to tell yourself, "Not now" everytime you start to obsess about your problems.
Having been through some pretty severe personal problems myself (including watching my spouse die by inches over the course of a couple of years), I found work to be a haven from those problems. You can put them on hold until you leave work and it helps you to deal with them during the rest of your life because you get the mental break from them. Try to learn to view work this way.
Now some of the next part depends on your boss and how your company behaves and the nature of the problem, but in general, I have found that it is much easier for the workplace to accomodate your needs when you have serious personal problems if you inform your boss of the problem as soon as you can. Tell him upfront what you are going to need to deal with the problem. It might be time off or a rearrangement of schedule, it might be a temporary reduction of duties, it might be a plan for how the workload will be handled when you go to the funeral you know is coming. Most people I have worked with are more willing to work with you to mitigate the effects of a personal problem if they understand what it is.
Consider your situtation from your boss's persepctive. He sees that you made a major error. He didn't know you were not working at full capacity. So he thinks less of you for the error. If you had told him in advance and made arrangements for someone else to do certain things or taken some time off to deal with the issues, then the problem might not have occurred or if it had, he would likely have been less upset about it.
Would you have been be more upset at the screw-up who didn't raise a serious problem or at the guy who made a mistake because he is trying to cope with his wife's serious illness? I have seen many many people have serious life problems from death in the family to a wife with cancer to a miscarriage of a wanted baby to a bad divorce and in every case, the person was gievn the benefit of the doubt if they told people about the problem up front rather than after they started messing things up.
Alcohol and drug abuse are probably the biggest problems that it may not help to talk over openly with your boss. In the case of a problem like that, still tell them you are having a personal problem without specifying what and make a plan for how you will handle it.
The one thing bosses hate is someone who doesn't give them the chance to rearrange work when needed and then things start to fail. It is far better to talk about these things and make arrangements. If you make the huge mistake and then say, "But I have personal problems", it comes off as an excuse. If you say you have personal problems and make arrangement for how to deal with them and then make a mistake, it comes off as understandable.
Another thing, since I notice you are a manager, talk to your team as well as your boss. Tell them less but enough that they know you are having some personal issue and then ask them to help you. Ask them to specifically tell you when you are getting off track, ask them to forward things that higher management needs to see and copy you or whatever other actions will help the work to get done effectively while you are not as effective. Let them know they have permission to keep things from festering.
Thinking about this further, I sense that you in general don't have good coping skills. There are two things I have learend in life that help me in handling problems effectively now (and believe me I learned these the hard way by failing spectacularly). Your question shows that you need to learn both these things as well.
First, problems do not get better by avoiding them or by trying to hide them. They almost always get worse. You have failed to address your personal problems in six months to the point where it is affecting your work. You even knew it was affecting your work and still failed to address that problem at work with your boss or your team, thuis creating an addtional problem making it still harder to cope. You got in trouble because you failed to pass on a problem that you should have and even though your own boss got mad at you for supressing it, you still call it minor. Every one of these things could have been better (maybe not great but better) if you had chosen to address problems rather than hide them.
Next, seek help when you need it. It doesn't make you look bad, it makes you look good. Asking for help is not weakness, it is strength. And it will help you get through the problems. And people love to be helpful. It will make you more allies in the work force (and in your private life too) and that will make facing problems as they come up easier.
Think about it. Suppose one of your subordinates came to you and said that he was having trouble at home becasue his daughter had cancer. Wouldn't you be willing to think of ways to rearrange his workload, so he could take her to chemo? Wouldn't you be willing to change the assignments so that he had less of the critcal path items (and wouldn't this reduce risk in your projects)? Wouldn't you be happy to let him have time off to go to a Children's hospital in another city (and even pick him up at the airport if need be) or arrange for him to work remotely? Aren't many of those things items that he would not be able to do for himself if he didn't ask? Wouldn't his stress be reduced in this case by your actions?
So learn to let others help you. It will reduce your stress and it will help get the problems fixed or at least mitigate the effects.