Many people think of an editor as the person who goes through a piece of work checking for basic spelling and grammar errors, like a teacher at school - but an editor can do much more for you than that. If you're serious about becoming a writer, letting a good editor go over your work can really give your skills a boost.
It's common to hear new writers say "I don't need an editor." Confidence in a writer is a good thing, but if you keep on getting rejection letters when you submit your work, the chances are that an editor could help you a great deal. You're not in school now, and of course you don't have to listen to criticism if you don't want to, but a good editor isn't like a strict teacher - he or she is more like a friend. Your editor will work with you to help you see the flaws in your work and to help you improve what you're doing. However successful he or she is, your favourite author almost certainly works with an editor. Writing is about creating. The editor isn't there to interrupt that creative process but rather to guide it and help you learn the discipline which is necessary to the production of any kind of art.
Working with an editor means that there'll always be someone there to answer questions when you run into difficulties. An editor can give you helpful advice and can help to get you started again when that creative flow dries up. When you've completed your work and have worked with your editor to polish it, you can be confident that it is much more likely to be accepted by publishers. It's an editor's job to know what publishers want and to help you be the best writer you can be.