It's a Murphy's law thing. When you want a relationship you don't find one. When you want to be single, you stumble into a relationship. I think it's a Universe thing. The Universe knows. So when you put a little faith in the Universe, everything looks brighter and better.
The one thing that people find most attractive is independence and self-confidence. Without these things on your side when you are single, a healthy and committed relationship flourishes into ugly dependancy and reliance. If you aren't feeling confident and capable at the worst of times, then focus on what you love. Building a strong base of friendships, hobbies and passions are what makes you inspired. When you are inspired your eyes are brighter. And everyone loves bright and sparkly eyes; they are full of intrigue and full of passion.
What is important to identify about attachment, is that it is never about the quality of the other person you are craving. It is about yourself and yourself only. A hole in any area of life means that a more intense focus shifts onto that of an idealised partner. When you are lacking in one area you focus on another. This happens in relationships far too often. Know yourself and put yourself first.
Know that whatever adversity you are facing (heartbreak or other), you will get through it. Time does heal all. More than anything, know that adversity is what makes you stronger. It makes you get to know yourself more than any other relationship can. Because, how can you get to know who you are when you have never spent anytime with just yourself?