First of all, learn about patience. It's normal that there are periods of little or no action at a table, so you'll have to get used to it (be happy, when playing live, it's even worse due to less hands played, and not being able to multitable )...
Also try to change your point of view on the hands played. If you lose the hand due to bad luck (villain got lucky), try to keep in mind that the decision you made still was +EV, and overall you made the right decision of playing the hand). If you lose the hand due to -EV decisions, try to approach it rationally, mathematically, and see where you went wrong, and what you should do next time. If that doesn't work, go get a breath of fresh air, as said above