I would say that as long as you have a big enough
bankroll to get through your losses, and as long as you are not risking so much money that losing actually effects you (in which case I suggest you take a break for a few months and stop doing that
) then it should be fairly easy to maintain positive thinking, by focusing less on what happened when you were all in or the coolers etc that you faced, and thinking more about whether you are putting your opponents on the correct ranges and thinking well generally. For instance, I will always be happy if I manage to induce my opponent to make a big
bluff with a gutshot, even if they get their 8% on the river and hit it. As long as you feel that you are outplaying your opponents and putting them into unfavorable spots where they are going to lose more on average then I think that it should be possible to maintain positive thinking during downswings. Remember that poker is not a game of short term skill and that one buyin you just lost is not the bigger picture. Luck all evens out over time so just enjoy the ride!
Hope that helps!