A canonical link identifies the preferred URL when equivalent or duplicate pages exist; it is a hint, not a command.
Example and use
For equivalent URLs, select the preferred one, set its canonical, and check internal links and sitemap; inspect the search engine’s choice separately.