There are all sorts of pinholes out there, laser-cut, acid-etched, etc, but probably the vast majority are home-made punched through foil. This is my way, garnered many years ago from the ideas of other folks on another forum.
The size of hole you need will depend on the focal length of the camera. There are tables online that give an optimal pinhole measurement for each f/l, but it doesn't need to be too exact. The distance between the pinhole and the film plane in the camera below is about 38mm, so a pinhole anywhere between 0.25mm and 0.35mm will be fine.
I use stiff copper sheet cut into a circle to fit in the shutter. The centre must be carefully marked. Create a dimple on one side with a ball-point pen by pressing down lightly against a piece of soft wood. Then, using what I think is an Arkansas oil stone (it's pretty fine) abrade the bump gently until a 1mm circular abrasion appears. This makes the metal sheet thinner for the needle. I use a numbered needle - mostly a #13 which is 0.3mm dia.
Carefully rotate the needle point against the inside of the depression - this is where you'll make burrs if you push in too roughly. The drilling motion is a bit like trying to light a fire, only real slow. Once the tip is through you should only go a short way up the 'cone' end of the needle, don't go right through - the hole is probably already bigger than the needle diameter, so stop. Carefully abrade the bump side again - and then put it on the scanner.
Check the diameter in mm under Image Size.
If it's not a circle you can try again gently with the needle. If the hole's too big - throw it away and do another.
Use a black felt tip pen in the area immediately around the hole and black paint over the back of the rest of it. Fit the pinhole disk into the shutter, with a few spots of superglue if necessary. This can be either behind or in front of the aperture leaves - you can check by eye whichever is best to avoid a vignette. With the shutter open, look though the open back from each corner, pointing toward a bright light. The pinhole brightness may fade at the corners but ideally it should still be visible.