Why does it matter if you try your best at getting something and you don’t get it ? It shouldn’t matter at all.
And the reason is this : you tried to get something you want. After trying , you don’t have it. So you didn’t lose anything.
Let’s say you want to start a company. And 2 years later, your company fails and you close it. No reason to dwell on it because before you didn’t have a company and now, you don’t have a company.
All you have is the lesson learned through the process you went through. And I would bet on you this time to start an other company, than I would’ve the first time around.