If you are trying to get published by NY—You write the book and then send it around to agents and any publishing house that will take submissions without agents. If you get lucky enough to snag an agent they send the book around to editors at the publishing houses. If an editor likes it they offer you a contract. The publishing house pays you an advance. The editor sends you edits. Actually you get a few sets of edits. Regular edits, line edits, galley edits. And then one day your book is out there.
If you going out on your own and publishing as an indie author—you write the book. You either pay an editor to edit your book. Or you can get a bunch of critique partners to help you go over it and edit it yourself. You either make a cover or buy a cover. But you have to make sure that you have the license for the graphics you use on the cover. You follow the kindle formatting guidelines and you get your book all ready to put up on kindle. And then one day you upload the book, the cover, the blurb, your bio. And you book is live and ready for people to buy.