A lot of poker is card-luck, pure and simple.
As much good luck you run into, you will see an equal amount of bad luck, in the long, long run.
At some point, your luck is bound to turn. The trick is to lessen your losses while waiting for the luck turn.
If you're running really bad, take a break from paying to play. Stick with free-rolls and build some bankroll.
Since you can't control the card-luck, don't blame yourself for bad play, if you know you'd played it properly..
Maybe this post will help turn things around at the tables, good luck going forward.
I usually do two things.
The first is to persevere and not go on tilt so you can take advantage of the next good hands.
The second thing I usually do is get up from the table if I feel like I won't be able to win that day.
In tournament? Remain as calm as possible and resist the urge to punt lol. I'm usually waiting for my spots, playing my range vs my opponents instead of my specific hand. I'm also looking for spots to bluff, especially vs passive opponents that do a lot of folding.