Most of the time people just find a template they like, copy the code into a subpage of their userpage (eg User:B0n b0ns/template) and mess around with that. As for how to make a template from scratch? Your guess is as good as mine. Better, probably.