It may happen that based on certain conditions, you want to display a block or eliminate it. You can remove block depending on config setting in Magento 2.
Attachment 15326
Check the programmatic method at https://meetanshi.com/blog/remove-bl...-in-magento-2/