When we were younger, how did we learn that the stove was hot? We often got a bit of a burn. We did not learn this from reading a book, but by trial and error. For some of us, it took a couple of times, but eventually we learned. Like anything in the world, we learn from those mistakes. We don't like the feeling of failure so our brain makes the necessary changes to that we don't do it again.
And then we come to publishing...
I don't know what it is about writers, but many simply do not learn from their mistakes. They keep doing the same thing, over and over again, and always end up with the same results.
Honestly, I am shocked by the number of authors who keep submitting to me with new projects that show me they have not learned their lesson. This ranges from authors submitting projects I don't acquire, to plotting or character issues that I tell them don't work.
For some reason, I think many authors think that this business is just about throwing darts and hoping that one of these days, their story will land in the right place and they become a "published author." Of course, these are often the same authors who believe their first and only book will be a 7-figure deal and Oprah will add it to her Book Club.
If you get a rejection letter from an agent or editor, read it and learn from it. Now, I do get that there are those out there who don't send letters and believe that no answer means NO (which IMHO is far from being professional). You might not be able to do much from that. But, if you get that letter, then go back and look at your story. Can you change your current story? If not, what are you going to do about your later story.
You can also learn from your mistakes and those rejections by actually taking the time to study the genre and line you want to write. Have you done that yet? If not...get to work.
I say this always and I will say it again. Being a published author takes time and you have to LEARN THE CRAFT! And yes, you need to look at those errors, rejections and failures to figure out what you did wrong so you don't have to do it again.