Your Android device
ADB and Fastboot installed on your PC
Computer with Windows 7 and above or Linux
All the correct drivers for your phone installed
TWRP image file for your device (ends with ".IMG")
If your device is locked or you cannot boot into the system, use the hotkey combination for your phone to boot into Fastboot mode and skip straight to step 6.
Make sure you have USB debugging enabled on your device.
Connect your phone to your PC via USB.
Open command line (CMD) in the folder you have your ADB and Fastboot installed or use Minimal ADB & Fastboot.
3. Type "adb devices" into the command line to see if your device is recognized by ADB.
4. Type "adb reboot bootloader" into the command line and wait until your device reboots into Fastboot mode.
5. Copy the TWRP image file to the folder where your ADB and fastboot is installed
(for example: C:\Program Files (x86)\Minimal ADB & Fastboot).
6. Rename the file to "twrp.img"
7. Type "fastboot flash recovery twrp.img" into the command line and wait for the process to finish.
8. After the process has finished, you can type "fastboot reboot" to reboot your phone back to Android, or, switch it off and use hotkey combination to boot straight into your newly flashed TWRP.
Flashing custom recoveries may void your warranty!