1) Have a solid bankroll to begin with. At least 30BI for cash games and 100BI for MTTs.
2) Move down to cut your losses and regain confidence.
3) Consider the possibility you are actually not a winning player in that particular game.
4) Play less and study more.
As for point number 3 its a really obvious one but often ignored. We all like to think, we are winners and "just running bad", but the reality is somewhat different. My largest "downswing" happened, when I started playing cash games on
pokerstars 2 years ago. I was playing a mixture of regular tables and Zoom, and at 2NL and 5NL I say profit in all the formats over some relatively small samples.
When I got to 10NL and 16NL, which I played simultaneously, I did really well at 16NL full ring tables. At this point I more or less stopped playing regular 6-max tables. I was however still playing Zoom, and that did not go well. At first I got a bit stubborn about it and wanted to prove to myself, I could beat these games as well. But after around 30k hands I simply gave up.
The truth is, noboby care, if you are beating 10NL Zoom on PokerStars, and if you are doing much better in another game format, then why not focus on that? Follow the path of least resistance and find your "money tree". I am saying this, because a lot of the time, when people claim, they are in a "downswing", they dont actually have any track record to prove, they are long term winners in that particular game, they are playing.