Even if a relationship doesn't work out, you can always take something positive from something negative. You never know what's around the corner.
Once you replace negative thoughts with positive ones, you'll start having positive results.
Every person, all the events of your life are there because you have drawn them there. What you choose to do with them is up to you.