Considering my experience as a writer and an editor, I find it can be incredibly challenging to fill these roles simultaneously. Moreover, it’s something I advise against. If you are going to self-publish, I highly recommend enlisting third-party help to edit and then proofread your work. (Again, these two functions should probably not be performed by the same person.)
Having an extra set (or two) of eyes on your work is a rule to live by, regardless of whether you are a would-be author, a business pro, or an academic submitting a thesis. Simply put, you are too close to your work to do it all.
Even with that disclaimer, there are ways to edit your own writing, if only to improve a draft while you bring another person into the fold. Some tips:
Fight the urge to edit while you are still writing. Do not rewrite or delete sentences or entire paragraphs on your first draft. If you must edit while you write, stick to correcting typos or figuring out a new way to start a sentence to avoid repetition.