If you are writing an ebook and you want it to be easy to use and look good on ebook readers (kobo, kindle, etc.) I would not recommend a pdf. A pdf just does not adjust very well for these types of devices and can be fairly clunky on a mobile device.
From everything I have read about formatting an ebook the best software out there is called
Vellum. Apparently, it just makes formatting a book super easy and people seem to love it. But it is not cheap ($249.99 for a version that does ebooks and print books and $199.99 for ebooks only) and it only works on Mac computers.
Formatting ebooks these days uses the same "code" as websites - html and css. You can do it yourself but the software makes it much easier.
While Vellum is supposed to be the best there is for this work there are some free options.
It looks like Draft2Digital has a free ebook formatting tool on their website. The page that talks about it can be found here:
https://www.draft2digital.com/steps/
Draft2Digital can also be a good way to distribute your ebook to the big vendors though there are other options.
Another free option for formatting an ebook is called Reedsy which looks interesting though I have not explored it much.
https://reedsy.com/write-a-book
One big issue people are having these days with publishing ebooks is trying to help their customers get the ebook onto their specific device. What is easy for a kindle might be a pain for a kobo reader. A lot of authors that are publishing multiple ebooks are using a service called Bookfunnel which handles all the issues with getting an ebook to the customer in the format the customer needs. Bookfunnel also provides customer support so you don't have to deal with that issue.
Here is the link:
https://bookfunnel.com/
My brother has over 20 published books and uses Bookfunnel and loves it. I got a few books from him and went through Bookfunnel and it was easy to get the books onto the kindle app on my phone.
I highly recommend looking into the Alliance for Independent Authors (Alli):
https://selfpublishingadvice.org/
They are a fantastic non-profit that really focuses on helping authors who want to self-publish get through all the steps. They are a membership based organization but they give out a ton of free content. I'm not a member but I have been reading their articles and listening to their podcasts and learning a ton. I plan on joining Alli once I'm ready to start writing my first book later this year or next year.
You might also want to check out The CreativePenn. I don't always agree with Joanna Penn (the owner of the site) but she has a lot of great information and is a very successful author of fiction and non-fiction books. Her website has a lot of good information for free and she has a weekly podcast that I have been following. She is also an adviser for Alli. Here is a link to a page on her site about formatting books:
https://www.thecreativepenn.com/formatting/
Hope this all helps and good luck!