This is a topic with varying opinions and I’m not going to cover them all. Instead I’ll just describe the tools I use to prepare my books for publication as print books or ebooks.
My favorite software for print books is Serif PagePlus. At present I’m using version X9 but I have used versions dating back to X4 with success and you can save a lot by purchasing one of the older versions from Amazon. When using PagePlus I create a file for all the front pages and then a separate file for each chapter. Then I create a book file for the entire book. Each chapter is then listed in the book file and a pdf can be completed from the book file.
I have used PagePlus since 2008 and it’s always delivered great pdf documents ready to upload to my printer which is Createspace. There are many other companies that work with self publishers but the service from Createspace has been consistently first rate. Createspace makes it easy to get your book published and distributed worldwide without any fees. You just pay for each book you order as proofs, for book signings, submission to the Library of Congress, etc. Once your book is published it automatically goes into Amazon and they create a fulfillment estore for you. It’s a good, solid system.
To format ebooks I used Microsoft Word because it’s what I have but I’m sure you can use other software programs. It’s easy to format a book even with photos or drawings and there are many instruction books and tutorials to help. I normally upload my ebooks to Kindle because it’s such a large market, however there are other options. One that I like a lot is Smashwords. You can upload your formatted book to them and they will distribute it to many other resellers including iTunes, Barnes & Noble, Kobo, etc.