To sharpen a chainsaw, switch on the chain brake, place the bar in a vice, and secure a guide between the rivets. Make sure that the arrows on it are facing the nose of the bar. When sharpening the saw, do it at the angle of the top plate of the cutter. Do several strokes using the file on each cutter, which should become shiny when sharp.
Don't be afraid to go too far down on the cutters when sharpening, as rollers on the guide are going to prevent this. Once you have sharpened all the cutters you can easily access, disengage the brake on the chain, move it forward until you can access unsharpened cutters, and engage the brake again. Complete the sharpening procedure until all the cutters on one side of the chain are sharpened, turn the saw over, and sharpen the other side of the chainsaw. Make sure that the depth gauges on the chainsaw don't extend too far up, as then they won't be able to reach the wood. To reduce their length, use a depth gauge tool and a file.
Make sure that the chainsaw is clean at all times, so it remains sharp longer. Don't use a chainsaw if it is dull, as this can damage it permanently. It is best to sharpen the chainsaw every time you refill fuel in the saw.