I have upgraded to the latest version of LibreOffice and the command Insert Table of Contents does not work I have used this command regularly in the previous version.
How can I get it to work in the new version?
What is your OS? What is the version of LibO? Without this information nothing can be done.
You also can file a bug report here: https://www.libreoffice.org/get-help/bug/