Security cannot be compromised when it comes to the online store. Hence to restrict the spam user to log in to the admin panel without authority, the best practice is to leverage two-factor authentication in Magento 2.4
Check the method to set up two factor authentication in Magento 2.4.
Check the steps to set up two factor authentication in Magento 2.4.