I've had my share of rejections, and each one is imprinted on my mind forever. Especially the nice ones. One editor critiqued my story and asked me to submit something else, a longer work. Which I never did since they wanted books and back then I only had time for stories.
Through years of writing and getting rejected, the helpful rejections are what kept me going. When I sent Uncut Diamonds out (under a different title back then), an editor sent suggestions on how to improve it. When I rewrote and wanted to resubmit to that publisher, I was bummed to find they were out of business. I actually figured I had a shot there. Another rejection letter suggested it would be a difficult sell because LDS women like to read novels set in either modern times or historical eras, and the 1970's was neither. Whether I agreed with that or not, I appreciated her time and trouble in writing me a personal letter.
When I finished Farm Girl, I sent it off to the University of Nebraska Press. They said it was too short for them, but listed several regional Nebraska magazines to try, who might be interested in publishing it as a series. I didn't follow that route since I couldn't let go of my vision of Farm Girl as a book. I didn't want it published in a magazine as a series of articles or stories. But still, what a promising rejection letter! And it came after just two weeks, which really impressed me. It's the worst to wait six months and then get a stupid form rejection.
I used to get those as a matter of course. Then one day came a glimmer of hope-- a form rejection postcard with these words written in blue ink: "Nice work, try again." I saved that one for a long, long time--my first rejection that was more than a form letter.
You can tell you're getting closer to publication when the rejections get more promising. When they contain a kernel of something more than "It's not right for us." When you get one of those, keep going. It means you're getting closer.