Honesty is the most important ingredient. You don’t have to be or have gone through something to write about it but you must have a heartfelt feeling about it so you can expose that emotion through your writing.
You need to have a beginning that builds to a middle and an ending, or at least an idea of where you’re going, as it is key to explore your themes and foreshadow things properly.
Another important thing is to revise your writings. Your first draft is likely to contain multiple errors, poorly phrased sections, and inconsistencies.
To do it, you must know what your audience expects from the type of writing you’re doing and then defy it.
Without the surprise, without the twist, if you don’t pull the wool over the audience’s eyes, then it’s unlikely you’re going to be memorable. It’s precisely the fact that things are not what they seem that makes a story interesting.
Good writing comes from perfectionism; meaning it lets you identify what isn’t working and how to fix it, and the rewritings hone your technique. Perfectionism is fundamental when you may only have one chance to show your work to an agent or a publisher.
But you also need to stay optimistic, otherwise, you'll get depressed and quit.
Personal Habits: How To Make Good Habits Stick, 6 Proven Secrets - Barking Up The Wrong Tree