Two-step verification is an optional feature that adds more security to your Whatsapp-account. When you have two-step verification enabled, any attempt to verify your phone number on WhatsApp must be accompanied by the six-digit passcode that you created using this feature.
To enable two-step verification, open WhatsApp > Settings > Account > Two-step verification > Enable.
By enabling this feature, you can also enter your email address. So WhatsApp can send you a link via email to disable two-step verification in case you ever forget your six-digit passcode, and also to help to protect your account.
If you have two-step verification enabled, your number will not be permitted to reverify on WhatsApp within 7 days of last using WhatsApp without your passcode. Thus, if you forget your own passcode, but did not provide an email to disable two-step verification, even you will not be permitted to reverify on WhatsApp within 7 days of last using WhatsApp. After these 7 days, your number will be permitted to reverify on WhatsApp without your passcode, but you will lose all pending messages upon reverifying – they will be deleted. If your number is reverified on WhatsApp after 30 days of last using WhatsApp, and without your passcode, your account will be deleted and a new one will be created upon successfully reverifying.
To help you remember your passcode, WhatsApp will periodically ask you to enter your passcode. There is no option to disable this without disabling the two-step verification feature.