Place the cursor where you want the table of contents
Apply heading styles to your section titles using Heading 1, Heading 2, and Heading 3
Go to the References tab
Click Table of Contents
Choose an automatic table of contents style
To update it, click inside the table of contents
Select Update Table
Choose Update entire table or Update page numbers only
