Acknowledge That You Can Get Irrational
Failure is one of the feelings that we all hate. Nobody wants to fail at something. But, all those irrational feelings should be acknowledged. Do not try to hide things under the rug. Instead, you should fully acknowledge those irrational thoughts and feelings. It will help you learn to deal with failure.
Be Realistic With Yourself
The worst thing that we can do is have unrealistic expectations. You must develop realistic thoughts around failure as sometimes it is apparent that you will fail at something, and it should not even bother you in the first place. For instance, if you did not win the lottery, you should not feel bad about it because your chances of winning are close to none.