If you forgot the login details (username and password) used to log in and access your WordPress dashboard, follow these steps to attempt a recovery.
Go to the WordPress login page of your website. Usually, this is either
https://domain.com/wp-admin
orhttps://domain.com/wp-login.php
Click on Lost your password? Link.
Enter either the Username or the Email address associated with your WordPress account.
Click the Get New Password button.
Check your email and click on the link to reset the password.
Set a new password.
Now, you can try to log in again with the previous username and the new password.
Note: If you forget the email address or username associated with your WordPress account, reach out to your hosting support team for assistance. They have the ability to edit the database and reset your password.