Make sure this code is on every page of your website. We recommend to paste it immediately before the closing </head> tag.
This really depends on how your website is built. But every CMS allows you to somehow modify the template and add the Matomo script somewhere before the
If you are using a popular CMS there is maybe a plugin that allows you to directly integrate Matomo: