How attached are you to your writing?
Have you ever considered that maybe you shouldn't be?
Reason #1: The more attached you get to a manuscript, the more misery it causes you. The moment you say “this book is my baby”, the more hurt you are when people don't buy it, or when they give you a bad review. Instead, I suggest being as unattached from your work as possible. Put 1000% of your time and energy into it, but be unattached at the same time and feel nothing when people crap on your story.
Reason #2: Writing itself is a very selfish craft. We spend tons of time alone, and we generally write the books that we want to write for ourselves. I've always thought this is a good form of selfishness because if you're truly focused, no one can hurt you, and you're not hurting anybody, either. If you fail, you pleased yourself and practiced the craft. If you succeed, the world buys into your vision and has fun right along with you. Regardless of either outcome, I suggest that it shouldn't matter—the only thing that should matter is the work you're doing, and your diligence in getting better at writing and marketing so that you can spread your message to those who have the capacity to hear your message. Yet at the same time, you can't isolate yourself in your ivory tower—you've got to be “in” the world, and participate in it. That's why mental fortitude and mindset are so, so important.
Only a few people in the world are published writers compared to the general population. As those precious few, we are called to share our gift with the world so that other people might be able to improve their lives or just escape into a story for a few minutes—but we can only tell stories that touch people if we get out of our own way. And that means being attached and unattached at the same time.
It's really that simple, and that hard.
