You know how sometimes you wake up with a word, a sentence, something ringing in your ears? That was me a couple days ago. And the sentence?
"there is a silver lining in everything. Just be open enough to see it & smart enough to act on it."
Agents rejecting you left and right? Look at your query. Check the first chapters of your book. Are they strong enough? Could they be stronger? Does someone other than your Aunt Mary need to read it first?
Publishers taking a long time? Write that next book. You won't have time once you're contracted, to experiment and make yourself better. Now's your chance!
Gone through your list of agents? Take a look at your book. If it's the best you can make it, and you still want to try, sub to smaller publishers yourself. Don't give up!
Got a bad review online, or someone trashed your book? Hey, you got it in front of another person, and they felt strongly enough about what you wrote to write something about it themself...and any publicity (within reason, heh) is good publicity.
Have a block on your writing for some reason? Take a little time out, enjoy life going on around you. Think of other ways to be creative and give your brain a break - maybe it needed it.
While I'm writing these down for me, so that I can remember those silver linings, maybe it helps you too.