The XML sitemap is a file listing all the URLs on your site that you want search engines to index. It works as a map for Googlebot, indicating which pages exist, when they were last updated and the relative priority of each one.
A sitemap is especially important for: large sites with many pages, new sites with few backlinks (the sitemap helps Google discover the pages), sites with dynamic content that changes frequently and sites with sections that are not easily reachable through internal links.
Sitemap best practices: include only canonical URLs (do not include redirects or noindex pages), update the modification date only when the content has actually changed, do not include more than 50,000 URLs per file (use a sitemap index if needed) and submit the sitemap via Google Search Console.