This is the big question, one I get asked on a frequent basis by new writers.
The saddest and quickest and most honest answer, which I never give, is "do better work." That's the foundation of all other advice. The easy answer is simply submit your work. If it's short, go to Newpages.com and you can browze zillions of journals, magazines, and online publications that are looking for material. If it's a novel, check the Writers Market for reputable literary agents to represent you. If you want to be a cowboy about it - and who doesn't like to be a cowboy? - you can even submit it to publishers directly. There are a few - but a rapidly dwindling number - of publishers that still look at unagented submissions. I have one other trick, taught me by Valerie Storey, called "the rule of twelve." It says that if you send out twelve submissions at the same time, one of them will come back with a positive response. Not an acceptance, necessarilly, just a positive response: even an encouraging hand-written rejection can be a big boost to a fledgling writer. Of course the rule of twelve also means you have to disregard policies against "no simultaneous submissions," but Iwon't tell if you won't.
But all of that comes later. How much later depends on your own fortitude.
If you're writing only so that you can get published, you're going to be quickly discouraged and give it up. If you're writing so you can get rich, you're just flat delusional. (I know, I know, J K Rowling did it. But just because she got rich doesn't mean she wasn't crazy. If you think you're Napoleon, you're still a lunatic even if you end up conquering Europe.)
First focus on doing the best work you possibly can. Then go back and make it better.
Robert Frost called this "building soil," a great metaphor we amateur gardeners fully understand. We bury compost and turn under leaf mulch, enriching, and enriching, and enriching the soil all year before we put in the first seed. For an avid gardener, good rich soil, as black as a beetle's back, is as delightful as that first ripe tomato.
Here's Frost's advice about what to do with writing before "rushing it to market."
“The thought I have, and my first impulse is
To take to market- I will turn it under.
The thought from that thought- I will turn it under.
And so on to the limit of my nature.”
The limit of his nature, in other words, he will craft and ponder, craft and ponder, to his very utmost. What is the goal of this? How rich should the soil be?
"Turn the farm in upon itself
Until it can contain itself no more
But sweating full, drips wine and oil a little."
"How can I get published?" is the wrong question. The right question is "How do I write work worthy of publication?" There's your recipe. Don't dash headlong into publication; work the soil, work it to the limit of your nature. Not just until you sweat, but until the pages sweat. Sweat oil and wine.