The reality is-- and this is hard for a poker player to accept-- that it is entirely possible for a good player's "bad run" to go on for any duration. It isn't likely, but it is possible. Just as it is possible to roll an unloaded die and for it to come up 6 some obscene number of times in a row. You just have to keep playing sound poker, no matter how bad the variance.

BUT, the flip side of this is that statistically, the longer a bad run goes on, the less likely it is actually due to variance. So during ANY bad run, you should be marking and saving notable hand histories (for internet players) or making a mental note of hands where you lost significant money (for live players) and replaying those hands in your mind and asking yourself if there were things you could have done differently. Maybe it is still variance, but you need to satisfy yourself of that fact or plug any leaks you discover.