1. First enable USB debugging from setting>developer option>. To enable Developer Options, go to About phone and tap the Build Number 6-7 times.
2. For this method, you have to install ADB and Fastboot on your PC first. Check this How to setup ADB and fastboot on Windows or Setup ADB and fastboot on Mac.
3. Download TWRP image file, rename it to recovery.img (optional) and place it in a folder where adb and fastboot installed.
4. Now go to installation directory open ADB folder and open the command window there by pressing and hold the ‘shift’ key and right-clicked anywhere in that folder.
5. Now connect your phone to PC and reboot the device into fastboot mode by typing “adb reboot bootloader”
And Type “fastboot devices” in command prompt and hit enter, it gives you serial numbers in return means your phone connect properly.
6. Type this command correctly in command prompt “fastboot flash recovery recovery.img” and then press enter. It will update TWRP recovery to v3.1.0.
7. Now type “fastboot reboot “ in command prompt it will restart your phone.
If You Encounter Any Problems, Just Post Your Threads At ALBDROID FORUM