There are two ways how you can redeem a code in your Microsoft account.
The first, a bit quicker option is to redeem it on the Microsoft website. All you need to do is click on this link, log in to your account and enter the product key in the activation window.
The second option is to redeem it in the Microsoft store on your Windows device: