If you're going to write for others to read, you'll face rejection. Editors will say no. Readers will criticize. It happens to every writer.
The key is not to take rejection personally. Your writing isn't you as a person. It's a craft you can improve.
Learn from Criticism
Not all criticism is valid, but most has value. Even harsh criticism often contains a grain of truth. Find that grain and use it.
Also remember: many famous authors were rejected dozens of times before finding success. J.K. Rowling's Harry Potter was rejected by multiple publishers. Keep going.