Not sleeping enough makes you grumpy. Drink too much, you feel hungover. Overeating makes you feel stuffed — or worse. Basically, when you do something your body doesn't like, you will feel the negative effects.
The pattern should be obvious enough, and yet we're constantly making bad choices that try to challenge the result. Whenever I do something my body doesn't like, I try to remember the unpleasant feeling, so I can recall it the next time I'm about to order another cocktail or pig out on Doritos. We all make unhealthy choices from time to time, so don't beat yourself up over it. Just recognize that your body is trying to tell you something.
I can only think of one exception to the rule: muscle soreness after a great workout. In those cases, you might hurt because you pushed yourself a little, which is OK. However, it might also mean you're not warming up enough or stretching properly after your workout, so don't ignore those signals either. Can you think of any other exceptions to the "what's bad for you feels bad" theory?