How to install new system for your android phone with the help of TWRP

unlock bootloader 

fastboot oem unlock
or
fastboot flashing unlock

get into the recovery mode by pressing buttons

Power key + Volume Up key

get into the recovery mode by running a command

adb reboot recovery
or
fastboot reboot recovery

get into the bootloader by pressing buttons

Power key + Volume Down key

get into the bootloader by running a command

in recovery mode, or other case that have ADB support

adb reboot bootloader

boot into the twrp

fastboot boot twrp.img

flash twrp to recovery partion

fastboot flash recovery twrp.img

force twrp to be in the top when boot

Install -> Flash img -> Flash to boot partion

just install a new system

Install -> Flash zip -> a_system.zip

install a system by using ADB sideload tech

adb sideload a_system.zip

adb sideload can be used in some third party recovery img directly

install some third party package

Put it into phone’s storage, then use twrp to install them

Install tips:

Upgrading from earlier version of your android system:
- Boot into Recovery
- Wipe system and cache
- Flash new_system zip
- Flash Gapps zip
- Flash Magisk/SuperSU/LOS-ROOT zip
- Reboot​