First, you need to make sure you are playing within your financial limits. You shouldn't be stressed out because you lost your stack on one hand. As Doyle Brunson says, buying another full stack should be just as easy to you as buying a hamburger/sandwich. If not, you are playing in stakes that are too high. Secondly, you need to focus on making the best decisions. If you suffer a bad beat, just ask yourself if you would have made the same decision again. If so, brush it off and focus on the next hand. If not, figure out how you could have played it better. Finally, if you find yourself getting frustrated and not able to focus, leave the game. Take some time to clear your mind. Take a walk. Do some things you enjoy. Come back when you are calm again.