How to create templates?

Excuse me that i am so “newbie” i am just interested and i want to know how do you make templates, i mean site templates in httml5/css ,what are the steps, what do you use,do you make the tempalte first in PHOTOSHOP and than convert in HTML/CSS?
Can you please explain me step by step?Can you give me a tutorial pls?