I shall now offer you the best advice I could possibly give on how to survive the long wait associated with querying agents, and then once again while your manuscript is on submission with editors:
I mean this in a literal sense, as far as that is possible. Emotionally distance yourself from the process, the waiting, the rejection. How to do that? By finding something else to occupy your thoughts and time.
With my own writing, I’ve learned how to pretty much sever ties with my emotions as far as a project goes by diving into something else. When one proposal is out the door on submission, it’s time to move onto another project. I still think about the proposal and keep tabs on its progress with editors, but I’m so involved in my next book that there isn’t much time to fret.
While I realize this should probably be filed under “easier said than done,” it will honestly be the only thing to help you stay sane in the months and years (yes, it can take years) of waiting. For the most part, publishing isn’t a fast business. It takes time to make quality books, and so you have to learn how to cope with waiting.