Magento 2 CMS offers flexible options to customize the default configurations. However, it is advisable to override block, model, and controller in Magento 2 than editing the core files.
The Magento 2 Controller is responsible for handling the incoming requests. Blocks are PHP classes used to connect or create a link between layout and templates. The Model represents the data of the application in MVC.
Visit https://meetanshi.com/blog/override-block-model-controller-magento-2/ for the detailed method.