Yes! What cookie said.
There is an acronym for that - HALT, when you are feeling particularly bad stop and ask yourself if you are Hungry, Angry, Lonely or Tired. If any of these apply, attend to it right away. Even if you are having trouble with sleeping, for instance, just go lay down for an hour or two and read and try to relax, sleep if you can.