Treat everything you do like an experiment.
Experiments tune your mind towards learning from lessons, identifying patterns and looking at situations objectively.
We all tend to get possessive over our ideas and even more when we turn them into projects that take our time, heart and energy... These experiences become painful since we have been conditioned to believe that we have failed when something doesn't go according to plan.
How can it be failure when you've gained so much knowledge and experience through your experiment/adventure?
Ideas work when they've been put through thorough testing, intentional learning and constant improvements.
The next time something in your life doesn't work out, try to look at the situation as an experiment of sorts. Voila! An opportunity to learn has been presented to you.
Always remember that most times, getting it wrong simply means that you're one step closer to getting it right.