First check your device OS. Then download the flash file of your OS and add it to your phone memory. The put your phone in fastboot mode and connect to your computer. Now execute the flash file from the computer. Now disconnect your device and reboot it in recovery mode. Now choose install update option and ensure that the battery is above 60%. Relax until it is done.