Creating a templating system would require you to learn and use a programming language such as Ruby or PHP, then code the templating system and content management system and host it on a web server.
There are hundreds of existing templating systems for PHP alone. Searching Google for "templating PHP" or "templating Ruby" will take you to resources to help.
For example, an article from Smashing magazine titled "Getting Started With PHP templating" talks about the existing open source templating systems and how to use them with PHP.
If you're just looking to keep a blog, coding your own templating system is probably overkill, and you might be better off learning how to create a theme using the existing templating system for your blogging platform of choice. (For example, you could start here to learn how to theme self-hosted WordPress blogs.)
But if you're interested in learning to program, templating systems can be very useful ways of keeping complex code out of your HTML templates and making your application easier for non-developers to use and adapt.