In new Magento Version by Default Magento 2 Enable Two Factor Authentication, but if you work on localhost, then it is not useful for this, so you can disable this.
Simply Disable the Module.
bin/magento module:disable Magento_TwoFactorAuth
bin/magento setup:di:compile
But before disabling the module check the module have depended on other module or not