This was a topic that I struggled with for a while. I used to get upset at dice, or my own mistakes, or any other number of things that would result in a defeat. I stopped asking questions, or looking at my play - and it was resulting in worse and worse games. How I finally learned to deal with the frustration of losing was to just focus on having a good game. Treat a bad roll as a positive experience for my opponent, congratulate them on a good tactic, or help point out some tactical options. Once I began doing that I had much better games which helped my frame of mind - and I started winning more whilst having more fun doing it.
So, while losing can be frustrating I have to remember that it's a social game between two or more folks. The point is to have fun, while the objective is to win - and I try not to confuse the two. Make sure to have a good solid conversation about things you did right, wrong, and things that your opponent(s) did right or wrong. Things look different from other points of view.
Also, if you blame your dice you won't ever be able to look at any decisions you made critically as it was always 'the damned dices' fault'. That was a big hurdle for me.