Since I've been working my way through common questions recently, I thought I'd try to give my answer to another. (As with any of these, my answer is my answer. Based on my experience, and part of what works for me, and keeps me, if not sane exactly, able to counterfeit it well enough. There are lots of ways to become a writer and please don't think that if what works for you contradicts what works for me that you're doing it wrong.)
So. How do you know when a story is ready to be sent out on submission? I get this one a lot, often in some version of "how can I make sure this story will sell?" I'm going to combine the oracular answer to the former with the more practical answer to the latter.
A story is ready to go out on submission when it is the best story you can write at that moment in time. Unless an editor sees enough potential in the story to ask for a rewrite, you only get one chance per market per story. So revise your story before you send it out. Give it to your writers' group, your beta readers, your friend who respects your work enough to tell you where the flaws are. Remember that revision does not just mean correcting spelling errors, although of course it includes that as well. Then think about your story - do you still see places where it doesn't work? If so, hang on to the story until you can fix them.
Does this mean that I expect you to write and rewrite until your story is perfect? No. Your story will never be perfect. And writing, like every other skill, has a learning curve - you will get better the more you do it. But unless you want to spend your entire career polishing the same piece of prose, there comes a time when you say this is the best I can make it right now, and you put it out in the world.
How can you guarantee your story will sell? You can't. Sorry. But there are some things you can do to make the submissions process less intimidating and less fraught. First, before you start sending your story out, familiarize yourself with the short fiction market. Learn what markets buy what type of fiction - no matter how good your hard SF story is, a magazine that specializes in epic fantasy is not going to buy it - and what they pay. Before you start submitting, decide what pay and prestige scale you are willing to accept for your work - pro only? semipro if the magazine gets reviewed or if the stories are often included in year's best volumes? token so long as you see your name in print? nothing if it's in a venue you really love? a venue you despise, but they pay lots and lots of money? - and stick to that decision. Stick to that decision even in the face of rejection letters.
Read the submissions guidelines for each market. Follow them. To the letter. The only thing that should stand out is the quality of your writing. If the submissions guidelines go beyond "please submit a .doc file in standard manuscript format," read those, too - if an editor is telling you that lusty pirate stories are a hard sell for her, take that seriously. Then go to your list of markets, and start out with your dream market, because it is not your job to reject your own work.
And realize the likeliest outcome is still rejection. Markets receive hundreds of stories a month, and tend to buy in the single digits. Your story may be good, and still get rejected if it was not to the editor's taste. Your story may be salable, and still get rejected - I have sold rejected stories. Many writers have. It doesn't mean that we sold to bad or second rate markets, it just means editors are people too, and like people, they have varying tastes.
And yes, the submission process can be nerve-wracking - I still get sick to my stomach every time I press "send." And yes, rejection sucks. It sucks every time, and on some days worse than others. Sending your work out takes guts, and I'm proud of each and every one of us who does it.