Sitemaps can be very useful when troubleshooting indexing issues. By having access to an XML sitemap, you can quickly determine the total page count of the website, which tells you how many pages you want indexed, and then compare it to how many pages are actually indexed, using Google Search Console.
If there is a discrepancy between them, this means there is a potential issue that’s causing certain pages to not show up in search results, and needs to be identified & fixed.