Tape a piece of graph paper to a surface where you can create a template. Lay your hardware item on a piece of graph paper. Secure the hardware with your hand or tape so that it does not move.
To create your template: carefully mark the location of each hole, using a pencil and ruler, on the paper. Once done go back and add an additional mark to two opposing holes. This will provide a reference when laying the template on the mounting surface.
The template will be the same scale as the hardware. If the hardware has an orientation please be aware that the template will mimic the orientation of the hardware laid out on the paper.
Once done remove hardware and detach paper. Use a hole punch to cut each screw hole from template. Be sure you can still determine the 2 reference holes.
Determine the hardware location on your cabinet or furniture. Measure and then mark the location of your reference holes. Knobs and pulls are typically placed 1" from side of cabinet door.
Place your template on the mounting surface you are attaching the hardware to. Line up the template reference holes with the reference holes you marked on your surface. Secure the template so that is stays in place.
Double check the reference holes on both the template and mounting surface line, they need to line up correctly. Check to make sure template is secure.
Carefully mark each hole location on the mounting surface. Remove template.
All the holes are now marked. It is best to first drill a small pilot hole at each hole location. Then come back and drill holes to correct size.