Recently I was trying a new ROM and it got stuck on the TWRP screen after a lot of research found this easy solution.
Just boot into Fastboot and type the following command:
fastboot format userdata fastboot format cache
Then install the TWRP again (Search and download the latest TWRP image from the internet for your device):
fastboot flash recovery twrp.img fastboot reboot
That's it :) Enjoy.