An additional note for newcomers
Thanks for this, it helped a lot as I'm completely new to this and really want to replace the old android 5.0 with something from this century.
One issue I kept bumping my head into was that after following the steps above, I could not get TWRP to work.
First installing adb on a PC, (ok)
then installing the new unlocked bootloader (ok)
and finally installing TWRP, (not ok)
after trying to boot into recovery it always ended up with "Error".
A cute little robot laying on its back with the message "error" ... No details beyond that.
Tried reflashing the bootloader and TWRP many times, including different versions of TWRP, but it would not matter.
No recovery for me.
But I'm a tad stubborn, so eventually it dawned on me to try and install the first TWRP from the list (3.2.1) and after that it booted into recovery OK and I was able to update to TWRP 3.3.3.
Now TWRP works OK (well it boots into TWRP, so I think it is now fine).