You must format each heading and subheading in Google Docs using its built-in “Heading Styles” feature. This will help Google Docs automatically generate the table of contents entries.