Writers have to be extremely persistent, ridiculously stubborn, and just a little bit stupid. Writers experience more rejection than most people do—or could handle. Writers either develop thick skin, stop submitting, or take up drinking.
I believe that the toughness it takes to keep putting yourself out there, and being rejected, over and over is a learned skill. We're not born with emotional armor, but we develop it because the writing is more important. We make a conscious decision to prioritize our aspirations above our emotional comfort.
There is no magic spell to make rejection easier. That said, there are a few "tricks" that make it easier to deal with. One of my favorites is the "one in, two out" rule.