Adjustable shelves are a feature that adds great flexibility to many woodworking projects. If you only have a couple boards to drill for shelf pins, you can use a piece of inexpensive hardboard pegboard as a drilling jig. Most shelf pins have 1/4" shanks and the holes in pegboard are 1/4". You should cut the pegboard to the size of the pieces that you are drilling. You may have to trim the top edge of your pegboard later. Mark the front and top of the pegboard.
If your first set of holes are to be 9-1/2" from the top edge of your cupboard side, draw a line on it 9-1/2" from the top edge. Lay the piece of pegboard on it and see where the line falls. If you can not see your line through a row of holes in the pegboard, slide the pegboard up until your line is centered in a row of pegboard holes. Next, measure how far over the top edge of the side the pegboard is extended. This amount should be cut off the top of the pegboard.
Mark the row of holes that are now centered 9-1/2" down on your pegboard. The rest of your rows of holes that you need to drill should line up with other sets of holes in the pegboard. Make sure that when you drill the side of your project, you keep your pegboard lined up with the its top edge and don't turn the pegboard over as this will change the horizontal alignment of the holes.
If you are using a portable drill or if your drill press does not have accurate depth stops, it is a good idea to use a stop collar on your bit. Some woodworkers use a layer of masking tape on their drill bit as a depth stop, but the tape will quickly wear as it contacts your template and an expensive cupboard side could be damaged as a result. Brad point drill bits do an excellent drilling job because their center points help prevent the bit from "walking" during use.
The holes in your template will become enlarged after repeated use, so if do a lot of drilling for shelf pins, you may want to consider purchasing a jig such as a Veritas Shelf Drilling Jig.