Okay, a bit longer this time. A lot depends on your mood. That is, if your mood is bad already, then potentially distressing experience will not be light on you. On the other hand, if you’re otherwise happy and stable, then you shrug it off easily. Sometimes it comes down to mundane factors like having a bad day, being hungry or cold or irritated because of “something”. On the other hand, sometimes the “something” lasts longer and/or is inexplicable, which kinda suggests that visitting a counsellor might not be the worst idea. Just like your physical strength is exhausted by large workloads, so can be your mental stamina or your emotional endurance.
Generally, itt’s motivation. If you motivate yourself, things go more easily, though it’s easier said than done. For example, I can tell myself it’s great that I can operate a professional job (in theory it’s a small business but in reality it’s just being “self-employed”), be a responsible tax payer and all. Filling the damn paperwork could inspire me with such feelings and thoughts if I were a better person (or at least more positive). On the other hand, usually when the Day of Paperwork comes, I go down with school fever and feel as bad as if a maths test in highschool awaited me. The solution is to just get it done and be over with (and pray to one day be that person who actually gets all those goodly thoughts about it). This works with stuff like exams, jobs, formalities, heck, even with women to some extent, but it won’t work when one has a more serious problem, e.g. an unsolved trauma, like stuff from childhood. Stuff like that needs to be talked over and processed properly instead of the traditional “grin and bear it” mentality. There is nothing “shameful” whatsoever in going to a guy who’s been trained to do it (just like you may be fixing his car or his teeth or serving his meals or whatever your job is where he could come into contact with you).
Also, this is kinda shallow, but I’ve discovered that allowing yourself to take some good rest, change the surroundings, go get some nice tea at a comfy place, or an interesting trip, read a good book, see a good film, play a computer game, and so on and so forth. We need rest. Rest is not only sleeping or just not working, relaxation and regeneration is a bit more complex than that. Sometimes it needs a change of surroundings, for example.
As for women, well, you mentioned an ex, right? That means you had a relationship at some point. Better or worse relationship as it may have been, but it actually started in the first place. By comparison, I usually have trouble at the point before it starts. Men and women are either compatible or not and the fate of most relationships is “failure”, which basically means “not compatible”. If you look at your “lost chances” and “failures” and all, you may notice that you wouldn’t be happy with any of those women, or you’d have a mediocre relationship plagued with petty squabbles or a feeling of missing something (which the break-up or “rejection” spared). That rejection triggers self-esteem problems and some women don’t have the people skills (or the politeness) to let a man down gently is a different thing (it’s more process than substance).
For the record, I experience the exact same feelings and temptations that you mentioned. I have a knack for narrowly failing too (especially professional exams I really should pass but it does go back to school times) in addition to an epic lack of luck with women (it provides a lot of amusement when sharing tales, so hard to believe is the streak). I know what you’re writing about, and I wish you a speedy recovery from that (temporary!) rut. Go so a counsellor or at least meet up with a friend, get a beer, get a conversation to sort it out. But don’t hesitate to go to a counsellor if you sense that it could be connected to some stuff from the childhood or the like. Those are extremely difficult to get out of alone because people don’t usually know how it works.
Also, personally, I try to avoid thinking about theological implications of it. Too easy to come up with some really stupid thoughts if one isn’t a properly prepared theologian.