Templates are small programs that produce some output based on calibre book metadata. I think a good place to start is examples where you can understand what the template is trying to do and look at how it does it. There are many examples in
the template documentation and in the first post of the thread
Plugboard, template, and custom composite column recipes.
A common use for templates is column icons and coloring. Perhaps people will share some that they use, showing the template and what it does.