Some people use Calibre to convert their files to epub. Then they use Sigil to edit the table of contents. I know because I used to be one of those people. That was before I discovered the "Edit ToC" tool in Calibre. Now I just use that, bypassing Sigil altogether. Nothing against Sigil; it's a fine program, and everyone should have it. But I've streamlined my process this way, so I'm sharing it with y'all.
Unfortunately, it's not self-evident how to edit your ToC in Calibre. The necessary button isn't activated by default. You have to add it to your toolbar. I'll show you how.
Important note: this tool is only for editing the ToC of an epub. I don't think it works for other file formats. So make sure you've used Calibre's conversion tool to make an epub version of your book before proceeding with the ToC editing.First, open Calibre and click on the "Preferences" button.
Then click on the "Toolbars & menus" button.
You will then be asked to choose which toolbar or menu you wish to customize. Choose "The Main Toolbar." You'll then get a screen like this:
In the "Available actions" box, scroll down until you see this:
Click it so that it's highlighted. Then use this arrow button:
...to move the Edit ToC button from the "Available actions" box to the "Current actions" box. Then go to the bottom and click "Apply." You should now have the Edit ToC button on your main toolbar.
Now you're ready to edit your Table of Contents.
Click on your book so that it's highlighted and appears in the right-side pane.
See the "formats" thing? Give it a glance to make sure you've got an epub format to work with. This is an easy thing to forget about.
Now click the Edit ToC button. You should see a screen like this:
As you can see, there are a variety of import options to help you set up your ToC. Give each one a try to see how they work. You can also make new entries from scratch. You can easily delete the extras, so don't worry about cluttering up the Table of Contents box. If you want to delete an entry, simply highlight it and then click the recycle button.
You can edit each individual entry in the ToC by clicking on it so that it's highlighted. Then you'll see a bunch of options appear in the right-side pane:
As you can see, there are many ways to go about editing your ToC. Calibre is a powerful program, and it's just a matter of playing around with it and seeing what it can do.
Good luck!