The element, story and editing, is entirely in the hands of the author. You are solely responsible for the content of your book. This is where you should spend the bulk of your time and money. Find a good editor. Editors come in various flavors: structural, line and proofreaders. Some writers use multiple editors. Some writers, particularly more experienced writers, know their weaknesses and employ editors to overcome their specific areas of concern.
You need a great cover. In the old days, when we shopped in bookstores, we wouldn’t normally see the cover. All we might see is the spine of the book. However, if the title caught our eye, the cover was next. Today, since most books are sold online, we see the entire front cover, so they are more important than ever. Don’t do it yourself. Writers, in my experience, tend to design a cover that depicts the book. That isn’t the same as a cover designed to sell the book. Hire an experienced cover designer.
The book’s blurb is that copy on the back of a paperback that is meant to intrigue us, make us so interested in the story that we buy the book. Not only does this appear on the back of the printed book, it also will appear on the Amazon listing for your book. As with the cover, don’t do it yourself. The same concept applies here as with the cover: writers write blurbs that are almost a synopsis of the book, but lack the copy that will sell the book. Find an experienced copywriter, someone who has experience writing ads, and get them to do it. It will probably cost you, but it will be money well spent.
Note that what I do, formatting, is not on here. Nothing you or I do in formatting will help sell more books. Nothing. No one ever picked up a book and said “Cool font. I’m buying this book!” or “Look at these drop caps. I’ve got to buy this book!” However, formatting is important because you can lose sales due to sloppy or amateur formatting. I’ve seen reviews, primarily about Kindle formatting, that I believe probably put some people off those books. Your primary goal with formatting should be to keep your costs as low as possible and spend the money saved on the three bullet points listed above.