I've been in your shoes. I've written four novels and endless short stories. I've been through the round of submissions and rejections, and the excitement of publication and payment.
It is vital to have editorial intervention before submitting to agents or publishers. Why? Because we all become word blind to our work, and you only have one chance to make that all-important first impression.
If your work is littered with errors, as literary agent Hellie Ogden says, "It is definitely off-putting to see a manuscript with lots of typos." So, unless you have a personal contact in the industry, your submission will go into the "slush pile" where hundreds of other manuscripts await... don't give the slush pile reader a reason to reject your manuscript because of avoidable errors.
It's okay to admit your grammar sucks, or you have no idea how to punctuate correctly. Invest in your writing by using a professionally trained copyeditor and proofreader to ensure your work is given that all-important final polish. Why? The professionals reviewing your submission for possible publication will notice.
One last tip: don't forget to read and follow the submission guidelines to the letter. You'd be surprised by the number of people who don't bother, and that means probable rejection.
The seven Cs of editing