Reference: https://www.malcare.com/blog/restrict-admin-access-on-wordpress/
Navigate to the root directory of your WordPress installation. . Look for the .htaccess file in the wp-admin folder.
Edit .htaccess and paste below code. Replace ‘12.34.56.789’ with the actual IP address of your computer.
AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "WordPress Admin Access Control"
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
# whitelist user1's IP address
allow from 12.34.56.789
# whitelist user2's IP address
allow from 12.34.56.789
</LIMIT>
If necessary, restart the server with below command.
systemctl restart httpd