Not only are bad beats just a fact of poker, if you play online poker they will feature many times per day.
Perhaps your problem is a lack of volume. If you don't play a lot, then a bad beat can not only be annoying, but it can have a significant effect on your winnings.
In the end, the only answer is to just shrug and move on. One hand isn't important (even when it is).
The fact that crappy hands can runout and come out on top is one of the greatest things in poker. If you just picked up AA and won every time, the game wouldn't be the same.
Additionally, those who win with crap are falsely rewarded...and are stimulated to play ore crap. This accelerates chips back in your direction before or after your bad beat. So use it to your advantage. Raise more pre-flop against these loose-aggressives, especially with premium pocket pairs. If a flush draw flops, instead of being cautious and letting them get it for free, you can "bet for insurance", ie, you make the pot-
odds so bad that calling is foolish -- and if they do, you're on the winning end 3/4 (+/-) of the time they're chasing flushes.
So how do I get to the point where I can just shrug?
Volume.
Understand WHY we want flush and straight chasers to occassionally win.
Learn more about the game.
Positive mental attitude.
Exercise more pot control (limiting the size of your swings)
Stop believing you should win every pot you are in, just because you start out ahead.
The reason it seems that too many of these bad beats occur is simply due to the fact that most hands don't get to the river.
Most of those hands, if they did go to the river, would not result in bad beats. But your brain excludes them because you don't see a full runout.
(And if you did see a full runout on every hand, you can be sure that you have fish aplenty in your pond.)
Chill bro.
Poker is to be enjoyed. Sometimes it takes some bad beats to be able to full enjoy when you're on the winning side of a race.
Cheers,
JT