In reply to Neha.

Do we need to make any changes in the code, for this? Or it will be inbuilt in the wordpress update itself.

WordPress will create a sitemap of public posts and pages and any public custom post types. Unless you or a plugin you’ve installed disables this functionality, such as Yoast:

And how can I remove the earlier sitemap that I have created using yoast. Do I need to explicitly remove that using the search console. Any idea?
Yoast disables this functionality, see https://github.com/Yoast/wordpress-seo/pull/15529