If you need to hide pages from search results, start by adding a "noindex" tag...
https://web-wiki.win/index.php/I_Noindexed_Non-WWW_But_WWW_Is_Still_Showing_on_Google:_How_to_Fix_the_Canonical_Mess
If you need to hide pages from search results, start by adding a "noindex" tag to the page header so Google drops it during the next crawl. For urgent requests, use the Google Search Console Removals tool to hide content immediately