I've been at sharpening my saw chains for 30+ years. (how hard can it be really?) Never really got it right until I checked in with my friend a really good tree surgeon and my mountain guy chainsaw dealer a few years ago.
They both file by hand. PERIOD. And they both gave me about the same instructions.
Warbler gave a clear explanation how to do it.
My tips (many have already been stated)
I got MUCH better when I started using a vise to hold the saw by the bar.
Alternately you can remove the chain, adjust your vise to that it's just slightly wider than the chain drive teeth, drop the chain in. Clamp and file the teeth that are in the vise, loosen vise, move chain, clamp vise, repeat. This works well for a badly worn chain.
KEEP the box the chain came in so you know it's exact file size and filing angles. I'm always amazed how much tooth angles differ.
The simple file guide is very helpful to get the angles right. It doesn't have to be perfect!!! Close is really good enough. I've got a chain that's supposed to be cut at 25 degrees. My guide has a line at 30 degrees. I guesstimate 25 and it works fine.
You can use a chain until the teeth are nearly gone. Much to my surprise! I took a worn chain to my mountain guy to buy a new one and he kinda laughed, put it in his vise and sharpened it...by hand. It worked fine.
Some chains have an engraved diagonal line across all the teeth. When the tooth gets that short it's finished. Otherwise, keep sharpening it.
When a tooth cutting edges are completely bright, you're done with that tooth. Remember, there are two edges. The obviously curved vertical edge and the not so obviously curved horizontal (usually also angled) edge BENEATH the flat top of the tooth. On a really dull chain it can take some work to get that edge sharpened evenly. You need to hold the file so that both edges are cut at the same time and therefore same angles.
Some chains have engraved diagonal line across all the teeth. When the tooth gets that short it's finished.
Do NOT file both directions. Only cut in the forward direction. Press file not hard against the tooth so that it contacts both the vertical and horizontal cutting surfaces, run it forward as straight as you can, move file away from tooth and pull it back. Repeat. Learning this motion takes some effort. I find that laying the file guide flat on the angled top surface works well. Remember it doesn't have to be perfect. Press the file rearward against that surface so you cut both at the same time.
File all teeth to the same length. Approximately is good enough. This gets harder the more times the chain is sharpened.
I had a well used chain that I'd managed to get a large difference in tooth lengths. I measured with calipers and found the shortest tooth. Then sharpened all the rest to be close to the same length. That took a long time. Chain is great now.
Take a quick test cut. If the chain isn't cutting good chips do it all over again. Now, all the teeth are bright, so how do you keep your place? I mark the top of the first tooth I sharpen with magic marker.
Quickest way to dull a chain? Hit the dirt or rock for even 1/2 second. Another good way is to let it get loose on the bar.
Whenever I put a chain back on the bar I find have have to re-tension it after only a couple of minutes of cutting. Don't run it loose.
If I'm in the field and the chips are getting smaller, I'll do a quick sharpen right there. If the chain is in good shape it only takes 5 - 10 accurate file strokes to get the edges sharp again. You can test sharpness with your finger. With a little practice you can tell the diff between sharp and not.
One more thing.....If your chain jumps the bar (keep it tensioned properly stoopid...don't ask me how I know) the drive teeth are almost certain to get burred. You won't be able to push the chain along the bar by hand because it will hang up on the nose wheel or the drive sprocket. You usually can't see the burrs but you can feel them with your fingernail. It's slow work but with a sharp medium coarseness flat file you can carefully file the burrs off. Even 1 burr will stop your chain from running.
I always make sure than when properly tensioned I can push the chain all the way around with my fingers.
Files have a finite life. Replace often.
It's quicker and much cheaper to sharpen your own chain than to drive down to the chainsaw store to have them sharpen it or to buy a new one.
Poor eyesight may make properly sharpening your chain impossible.