In the first case, you can set a new password for your account by entering your registered email or phone number. Once you type and click Next, Microsoft will send you a code on your email ID or number. Get that code to reset a new password.
In case the two-step verification is turned off, then go to the account.live.com/acsr and enter an alternate email address to get the password reset code, which will be used to set a new password. Please contact a Microsoft customer support specialist if you need further help.