1. Do something else
Go out for a beer, take your girl to a cinema or whatever it takes to get it off your mind. If you keep thinking about losses you will only compound mistakes. Know what you own, and if there is value in your stocks, you will sleep comfortably. Thinking over and over that you should have sold some or kept more cash won't help you. Analyze any mistakes you made, learn from them and move on.
2. Read a good investing book
Classics like Intelligent Investor or Market Wizards from Jack Schwager always help me get through rough times. You have to remember that stock prices deviate frequently from underlying intrinsic values, and unless that value is impaired you are getting bargains. Advice from Ben Graham, Warren Buffet, Ray Dalio or Richard Driehaus really force me take a step back and realize that market swings are irrelevant and unpredictable. What matters are sound investing principles applied with prudent risk management rules. Take these times as an opportunity to relax and read more about stocks to improve your future performance.
3. Think long term
No investment strategy makes money all the time. We go through ups and downs, and you can do well only if you think long-term and stick to your plan during market turmoil. This is what separates winners from losers. Winners know, that their strategy will go through periods of underperformance, but as long as it is fundamentally sound, they will come ahead over a long term horizon.
4. Go exercise
Fresh air can really clear your head, whether it's taking a walk, going to a gym or playing hockey, you will feel much better after. There is an old saying: "Healthy mind in a healthy body". Your thinking will be better because you already vented your frustration about market losses. Everybody feels much better and healthier after a little exercise!
Everyone goes through periods of sustained losses, you need discipline and a clear strategy to make it through. Hopefully this helped a bit, if you have any other advice, please share it below!