The first step in sharpening any hand saw is to sandwich it into a vise or between two pieces of wood that can keep the metal from vibrating, and driving you crazy, while sharpening. This is not just for comfort. If the blade vibrates too much, the file cannot dig into the metal.
Next you need the proper file. For western style saw teeth you need a triangular smooth file but there is one catch as to the size of the file. In the first drawing you can see where I have drawn a red line on the file showing the mid point of that particular file face. Notice that the teeth do not reach the mid-point. This is important because as the file itself wears you will want to rotate the file. If the teeth reach past the mid-point, the other part of this same face will get warn and not be useable. By making sure that the file is wider than twice the depth of the tooth, you actually have three complete files rather than only one.
If the teeth are very uneven, start with a flat file and go right across the top of all the teeth, bringing them all down to the same height. Yes, this dulls all of them but will make them all the same height and hence they all share the work, not just the long teeth. If they are not different heights, simply start with the triangular file.
Settle the file into a groove and move it around until you can feel that it fits tightly. This is the right angle for sharpening. You will be grinding two faces at a time so press down into the saw, not against one or the other tooth. Count your strokes so you remove the same amount of material at each tooth. Jump to every other slot this way with the same file angle. Then reverse the angle to come back sharpening the alternate spaces. The best procedure is to respect the angles in the original saw, unless you know what you are doing and want to create a more aggressive or less aggressive saw bite.
If the saw binds in the wood you are cutting you may need to use a 'saw set' which is a special device that bends the teeth to the left and the right to create a clearance kerf for the blade itself.
More and more we are seeing saws with Japanese style teeth. The metal on these saws generally are harder with a higher temper to keep these very pointed teeth sharp. That also makes them more brittle and harder to sharpen. The true Japanese saws are pull saws and the cutting tip is reversed compared to a Western saw. More and more western saw companies are making variations of the Japanese saws, using the form of the tooth but in a push direction. Study your saw carefully to be sure which way you need to hold your file.
For Japanese teeth, sometimes called Shark's teeth, you need a special small feather file as the angle is much steeper than that of a western tooth. You will find every other valley alternates in direction exactly like the western teeth and you proceed in the same way with this saw. Once you have done all the valleys left and right, then you have to come back and touch up the third sharpening angle which is that almost flat spot on the top of the tooth. Again, carefully follow the original angles. This flat spot is important because by changing the angle at the top of the tooth it gives strength to the cutting tip, making it last longer.
If you have a tempered saw it is difficult to play with the 'set' of the teeth without simply breaking off the teeth. If you try, bend the teeth sidewise very little. Japanese saws don't need the same clearance as western saws because of the pulling action.