Here's an article on that.
https://vborg.vbsupport.ru/showthread.php?t=228078
You really just have to create the template object and call render(), but the big difference is that you have to register all the variables used in the template, where you didn't have to do that at all in vb3.
Also the template syntax changed. That's described in the manual:
https://www.vbulletin.com/docs/html/...emplates_intro
Basically, <if> and <else> are now <vb:if> and <vb:else>, and where you had $varname before you'd now have {vb:raw varname} (but not in condition="", those would stay the same).