A few years ago I kept meeting people - in real life and online - who maintained firmly that it's pure luck, whether or not you get a publishing deal. Apart from the fact that to say that to someone who's just got a publishing deal is rather rude, it's also not true. It's not completely false, either, though even if you do spill coffee down the Editorial Director of MegaBooks, and get chatting, s/he may offer to read your manuscript, but MegaBooks won't buy it if it won't make them a profit. And if it's good enough to get a deal that way it probably would have got one without the dry cleaning bill. Most of those stories of amazing luck are polished up to make - well - good stories. Sometimes it seems as if the reading public and the journalists who feed them would rather attribute a publishing deal to anything except the dull business of one person sitting down and writing a book, maybe for years, until it's good enough.
So what should they be attributing it to? Well, one thing I've just touched on: writing, and re-writing. Hard work, in other words. Doing what you do properly, researching thoroughly and as thoroughly leaving the research behind, not skimping the dull copy-editing jobs or the brain-spraining search for the perfect word, not ignoring that persistent little voice inside you which keeps saying that a whole character, or the whole book, needs re-writing. Hard work too in undertaking whatever kind of writing-training suits you best: anything from a vast reading list of Great Works and a solitary and enquiring mind, to a Masters degree.
And of course hard work stretched over years takes persistence. Persistence in writing and re-writing; persistence in following up every lead and making the most of it; in submitting widely because you can't second-guess people's personal taste; in starting something new while you're in the long agony of waiting to hear; persistence in the face of standard rejections or unhelpful or even hostile feedback; in grinding on with a new novel when everything that's happening to the first, good or bad, conspires to tell you not to bother.
The only pure luck I would recognise is that what you write best is what readers at the moment particularly want to read, or better still, what at least one agent and one editor think they'll most want to be reading in two years' time. Perhaps another kind of luck is being born with the kind of determined, confident nature which is naturally hard working and persistent (though you may, like me, only have that nature in the context of your writing, and be a slapdash, corner-cutting abandoner of every other kind of project) and persistent too in being thin-skinned as writers must be, but thick-skinned when it comes to going back out there after the wound of a rejection. And, yes, I'm not being dramatic: having your work rejected hurts. A lot.
And there's one more thing you need, apart from hard work, perseverance and luck. Talent. In a way, that's the ultimate luck: to have had whatever combination of nature and nurture it takes to end up with more of a talent for words than the next aspiring writer in the Post Office queue: an ear and a tongue for writing those words down; an instinct for what makes stories and characters compelling; a mind that can layer thoughts and feelings and ideas up and over and among each other, and still keep the reader awake far into the night, wanting to know what happens next. Maybe most of all a talent for recognising which of these you lack, and trying to make up for it.
In fact, making up for what you lack is the key to it all, and the reason no aspiring writer should give up in despair. Because very, very few of us have the full house - talent, hard work, persistence and luck - when we begin. What happens, if you really are a writer-in-the-making, is that plenty of any three make up for lack of the fourth. Luck in writing naturally what's flavour-of-the-month, or in having a publicity-friendly CV, can make up for lack of deep talent (for now, at least). Lack of luck can be made up for by persistence till you do reach the one agent or editor who completely 'gets' your work. Hard work at learning to write better is as important as 'natural' talent, which isn't much use without persistent discipline. Most of what people call luck seems to me a case of putting yourself and your work in enough places, at enough times, that one day it's the right time and the right place. That's persistence, not luck, and you can do something about that.
You can't, arguably, do anything about your talent, beyond making the most of what you have. There's the mystery, and there, among supportive groups of writers, is the elephant in the room. Because some writers do have more than others. They're not always the most successful, either commercially or in literary terms, because some of the things which form a real, blazing talent are not healthy or balanced or conducive to coping well with your self and the world. But we all know it when we see it. And in the end, that's not only the mystery, but also the magic. Maybe when journalists spin silly stories about luck, that's really what they're trying to put their finger on: the mystery. Luck, you could say, is the non-writer's explanation for magic. Talent is the real thing.