Hiding a header script in certain pages

Is there a way to properly hide a header script in certain pages? I referred to https://support.wix.com/en/article/velo-tutorial-hiding-an-element-on-certain-pages and used an ID attribute for a JS script but it doesn’t work.

Appreciate your help. Thank you!