So, what? You lost a game of chess or missed a shot in pool. Why does that have to destroy your sense of self? Perhaps you’re tired and more volatile in the face of your failures. Your actions are not the way of an equanimous man.
Remember all that you know. For one, the obstacle is the way. When you fail, you have reached a point of growth, and you should cherish it and take advantage of it. Second, ego is the enemy. If you’re disappointed in your blunders because they destroy your sense of self, it is because you value who you think you are too much. Your pride is easily damaged and cannot be your primary driving force. Third, equanimity. You cannot indulge in every rise and fall that occurs because you will not experience any consistent peace. Control these impulses, and you will live a steadier life.