You’re following this tutorial, right? I think that page’s headers aren’t as clear as they could be, but the next several subsections after ‘edit default.hbs’ tell you specifically what code to put where.
As an aside, if it were me, I wouldn’t edit default.hbs, because I only want a ToC on my posts and pages. In that case, you’d edit post.hbs (and also page.hbs, if you have a separate one). No sense in loading the extra javascript on the index pages where it won’t actually get used.
I want the TOC on just one page. Putting one on every post would be crazy. It looks as if it would be easier to handcraft it on an HTML card and maybe store it as a snippet in case I ever need to do one again.