There's a lot of chatter among writers when it comes to agent rejections or rejections from publishers. Rejection will always sting, but you can create an effective shield against its effects.
If writing is the only thing you do in your life, and rejections send you into tailspins of depression, then you need to pump up your self-morale. How do you do that? Expand your universe.
When you write, write great stuff, whether it's an email, a note to a friend, or short stories to pass time. Get involved with groups - readers, writers, guilds - anything where you can achieve a victory. You beat rejection by winning many small victories.
Take your writing to the streets. Give lectures, go to meetings and tell people a story. Measure the response. When you gain a victory, like when people come up and say, "Hey, I enjoyed your talk," go out and buy a chocolate sundae. Don't just write one book and sit on it like a big egg, waiting for it to hatch into some grand exotic bird. Farm you craft in many fields. Take your stories and tell them fifty different ways and present them in front of as many people as you can. If they are accepted with respect, you have defeated rejection. You know your work is good. If rejections come, you can say to yourself, "Hey, Scrabbleworks Publishing Company, your loss, fool.”
Instead of always having to walk around with a stiff upper lip that makes you look like you had a bad facelift, building wall of thick resentment in your mind to thwart off rejection blues, or lose friends because you're a sourpuss all the time, do an end-around play and defeat rejections with great self-morale.