sitemap.xml is useful while indexing your pages on google. The search console recommends uploading a sitemap.xml file in order to regularly update and index new pages.
If you are using WordPress, you have a free tool YoastSEO that generates the file for you.
For websites other than WordPress, you can search google for “free sitemap generator” as all websites create similar sitemaps. Sometimes there is a cap of 100 pages to include in the sitemap in free versions.