When you read a book you know when it is finished, because you have reached the final sentence on the last page of the last chapter. When you are writing a book it is hardly that straightforward. When you have finished writing the last page of the final chapter, you will probably need to go back to the beginning and edit.
Even individuals who edit as they go need to do one final read through in order to know that the whole thing makes sense. No gaping plot holes, no strange tense shifts, no funny typos. But even then, how can you be sure that it is ready for publication, or as close as it can be? The following three steps should be taken before you submit it to an agent or self publish it.
1. The first step is to wait a week, or ideally a month. This might seem unnecessary, and hard to do at the time, but this week or month break from your manuscript should help you look at it with fresh eyes. You will have more perspective for your own self editing.
2. The second step is to print it out and read it. This may seem really obvious, but there are a lot of mistakes that are harder to catch on the computer than on paper where it is easier to read. Also you can edit directly on paper and then plug it into the computer afterwards.
3. The third step is actually something you can do during the first step, because it does not involve you reading the manuscript. Instead you should find a friend whose taste you trust, and get them to read the book. If you don’t have any friend that stands out as particularly well read you can try to find someone through a writing group, or even through an online forum.
When you give your book to them, make sure that if you have any pressing questions for them that they are written down at the end of the book, otherwise this friend might not give you the feedback you really need.
After you have done these last two rounds of editing based on your reading of the manuscript in print and the editing round based on your friends feedback, you should feel ready to submit your manuscript anywhere, or self publish it.