Do not sit and wallow in despair because it didn't work out. Though you are unable to see it now, it was for the best. Something better and greater is waiting for you, but first, you must allow yourself to heal. View your errors in life as learning blocks and not as failures. Failures are a result of giving up without trying your best. Therefore, if you know you've given your best in your situation you should be able get pass it with your head held high, and a brain filled with newfound knowledge and wisdom.
If it's a broken relationship that has placed you in despair, remind yourself that there were two parties involved. You cannot fix a broken relationship on your own. It took two individuals to form a relationship, and it'll take two to mend whatever is broken.
Never settle for less than you know you're worth. Know and believe you're of great value and that someone will walk into your life and see you for what you're worth. Even if that person does not appear, be confident and strong in who you are and what you've been able to achieve.
Have a blessed day!