In Magento2 currently, I override XML file using below way and make required changes.
app/design/frontend/Vendor/Theme/Magento_Catalog/layout/default.xml
But I have seen in Magento dev docs different way to override XML.
app/design/frontend/Vendor/Theme/Magento_Catalog/layout/override/theme/Magento/luma/default.xml
Can anyone explain what is the difference between Extend a layout and Override layout.
Best Answer
Extending a layout:
Rather than copy extensive page layout or page configuration code and then modify what you want to change, in the Magento system, you only need to create an extending layout file that contains the changes you want.
Override a layout
Not all layout customizations can be performed by extending existing layouts. If the amount of customizations is large, you can use the overriding function for the needed layout file.
You can find a detailed tutorial at Magento Official site at below link
Extend Layout Source
Override Layout Source