To fix the issue you can reset the password of your 0365 account and try to install it again. Follow the steps below to reset/change the password of your office 365 account
Login to your Microsoft office 365 account
Click on the name and then click on Identities
Next, to the Microsoft office 365 email address, there are two tabs that will help you to change and reset the password as mentioned below

Please follow the steps on the link below to install 0365 on the device:
https://support.office.com/en-us/article/Download-and-install-or-reinstall-Office-365-or-Office-2016-on-a-PC-or-Mac-4414EAAF-0478-48BE-9C42-23ADC4716658