Confession Time: Not so long ago, I used to be SUPER pedantic about grammar and spelling in books. If I found a word that wasn't spelled right or an ellipsis that was only two dots, I would feel so superior and want to shout it from the rooftops (even if it was the only mistake in the entire story). I think it mostly came from my secret desire to be an editor – like, “Hey, I found this error! And this one! See how good I am! Hire me! Hire me! HIRE ME!”
But that's not what writers want to hear. Honestly, it'd be weird to have someone come up to me and say "I found a misspelled word on page 54" and then walk away without saying anything else. But what about the 59,999 other words that were spelled correctly? Did you like any of them?
Over time, I've learned that I'm perfectly capable of forgiving an error here and there. If I read a line and think "That should be gasp instead of gas", I'm able to move on. After all, writers and editors are human, and humans miss things. Even big publishers sometimes get things wrong. And, yes, even I make mistakes (I wouldn't be surprised if there's one or two in this post). If you're writing a 50,000 word novel, there's absolutely nothing wrong if a few mistakes accidentally make it into the finished project.
But don't get me wrong: I'm not saying that editing isn't important, because it is.
If you're writing a book, then presumably you want people to be able to read it. And it turns out that it can be pretty difficult to read something that's riddled with spelling errors, continuity errors, and/or misused punctuation (just ask a teacher). When someone reads your book, you're asking them to use their brain to dive into your story and imagine your world, and that task becomes much more difficult if they can't figure out what the heck it is you're trying to say.
Now, I'm not talking about style – because some people have different styles, and some authors like writing in specific ways. What I'm talking about are stories where there are more mistakes than characters.
For example, a while ago I read a self-published story where the last half of the book was literally riddled with errors. There were tense shifts that moved from past to present in the same paragraph; dialogue tags with the wrong character's name; letters and entire words missing from sentences; sentences with extraneous words and letters thrown in; and, yes, even a their/they're/there mix-up. The problem with these errors was that they were so frequent and so numerous that I had no time to shake off the last one before the next was in my face. Instead of letting myself fall into the world of the story and grow fond of the characters, my brain had to fill in missing words and letters, extrapolate who was saying that line of dialogue, and try to figure out what was actually happening. I was working so hard at deciphering the story that I couldn't read it. And if you ask me how that book ended, well... I can't remember.
If you want people to read your book then it should be readable. It doesn't mean that your work has to be 100% perfect or that you have to know the precise rules for how to use a comma (because, let's be honest, commas are magical creatures that cannot be contained by us mortals), but it should be given a once-over before you shop it out or publish it. Many places will reject a piece because there are too many errors, no matter how good the premise is.
But what if you're not a master-editor? Luckily, the internet exists. Not sure how to spell something? Ask the internet. Not sure if that phrase is right or if you're using that piece of punctuation correctly? Ask the internet. If you have beta-readers, ask them if the grammar/spelling looks good. And you can even do an editing-pass-through on your work where you carefully look at each word and sentence to see if everything looks good. It's tedious, but it works.
And if you make the odd error once in a while, don't beat yourself up. After all, nerbody's pofect.