[My fault for not reading the community name closely]
edit: each person needs different advice. From your situation you could use career counseling, which most cities have some form of free programs. If you feel compelled to self harm or punish yourself seek medical help or at least someone you can trust and be around. It's not and it's never too late, call 988 or your local crisis hotline if you feel on the brink. If you need to take a break, take a break. Having someone in your corner can help you keep going, take things one day at a time, conscious replace negative thoughts with positive ones even if you don't believe it yet. Lots of strategies are out there, one or some combination thereof should work for you. Good luck and I know you can do it.
Original answer: Don't give up! Unlike gambling, this is something that you never lose until you give up. Just know that it's generally not because of your poor skills why you aren't getting the jobs that you're interviewed for. Sure, sometimes it's because someone else's skills are better than yours but often it's just luck, some stupidity on their end (they just "forget" to hire someone for several month) or a myriad of other reasons, most of which are not your fault.
Just assign a percentage to how likely you will move on from an interview stage... pretend it's 10% for example. If you did 10 interviews, then there is only a 34% probability that all 10 would reject you. I.e. the more you try the higher your chances.