There is a ton of this type of info on the forum.
Here's a quick and dirty rundown of my routine:
Shave in shower.
Undercoat of olive oil, with shave gel over the top.
I shave above ears, then sides, then back then top. Go against the grain for best results (if this irritates wait for a week or long enough for you skin to toughen up abit).
Another tip is wet your head ahead of time and let the warm water soften up your hairs for better results.
As your are shaving, run your other hand over that area afterward and feel for leftover hairs.
It's like mowing the lawn, if you can still feel stuff go over that area again.
You should use a fresh blade, a Mach 3, Fusion, Headblade or some kind of top level razor.
I rub a small amount of lotion into my head after the shave to soothe any irritation and dryness.