How do you tell the difference?

I feel like lately, I've gotten a lot of bad beats. Things like losing with a king-high flush against an ace-high flush. Or a loose aggressive player reraises me...