First thing is to memorize your password thoroughly so that you do not forget it. No doubt the password should be strong enough to keep your account secure. The best idea is to create a hidden folder in your personal computer in which you can save your passwords along with your user IDs.
In case you can't remember your password or ID, click on ‘I can’t access my account’ which is present in the same dialogue box where you enter your password and Yahoo ID to sign in.
A new page will load where you will be asked about the problem you are having with your Yahoo! Account. Select from the options viewed on the page and hit the Next button.
On the other page you will be asked to enter your Yahoo ID and the Captcha code that will be shown to you.
Next you will be requested to select the secret question you picked when you were creating your account. You will also enter your alternative email address.
Click Next after you have given all the required information.
A link from where you can change your password will be sent to your alternative email address.
Log in to your alternative email ID and click on the link sent to you in your mail.
You will have to think of a new strong password. Enter it and hit Next button. You will be permitted to enter into your account.