Is it needed?
The easiest way to tell if your chain is on its way out is to examine the waste from saw cuts. If it is very fine and dusty it is time to sharpen whereas if its bulkier and mainly chips its fine. Remember that a dull chain greatly increases the risk of kickback.
Sharpening
The cutters on the chain have semicircular cutting edges with specific diameters so to sharpen them you need a round file of the same diameter. In front of each cutter is the depth gauge which controls how deep the cutter can get into wood. these depth gauges need to be a tiny bit shorter than the cutters but over time the cutters can be worn down from both use and sharpening so you will need to lower the gauges to the right height with a flat file. Sharpening like this isn't too difficult if it is worn down from use however if the cutters have been damaged or nicked by stone or anything hard you may need to take it to be professionally sharpened or you might even have to buy a new one.
Safety
Make sure the chainsaw cannot be turned on while disassembling it and at least wear gloves and safety googles while working with a chainsaw.