I've listed below the tools and steps I used recently to replace the chain and sprockets on my son's 2005 Ninja 500R. I've read numerous guides and each one adds a little bit of knowledge. Please do not use this post as your only guide. I recommend using cyclepedia.com for more information and torque specs.
Tools and parts
RK Racing 520xso chain and sprocket set.
Xgunion Motorcycle Bike Chain Breaker Splitter Link Riveter Riveting Repair Set Tool Kit. This was a $30 set, and it did the job for me. If I were to purchase a more expensive tool, I'd go for the tool made by RK racing because I believe the rivet tool is designed to more easily and reliably rivet the RK masterlink.

Angle grinder. You may also be able to use a dremel.
I've included below the high level steps that I followed. However, I recommend that you follow one of the more thorough tutorials, linked below.
Step 1: Watch these videos so that you get a visual of the steps (links courtesy of ex-500.com)
- Overview of chain tool
- Chain & Sprocket Removal Part 1
- Chain & Sprocket Removal Part 2
- Chain & Sprocket Install Part 1
- Chain & Sprocket Install Part 2
Step 2: Review the following blogs which describe the process.
Step 3: Loosen the sprocket bolts
Place the transmission in neutral and use a short board to prevent the back wheel from turning. Loosen the bolts holding the front and rear sprockets. I also had to have an assistant hold the rear brake so that I could loosen some of the rear sprocket bolts.
Step 4: Use your angle grinder to cut the existing chain off the bike.
You can also use the angle grinder to grind the heads flat one of the chain links and use the chain tool to push them out. I did try that at first, but I didn't trust my budget chain tool to be sturdy enough to push the pins through on the stock chain.
Step 5: Remove the rear wheel
Remove the rear muffler and disconnect the rear brake caliper. Use some wire to hang the caliper. Remove the rear axle nut and push the axle out. I used a long steel punch to push the axle out.
Step 6: Clean the rear wheel and replace the rear sprocket
I used tape to seal off the innards of the hub and used only mild soap and water. It was very rewarding to get all of this cleaned up!
Install the new rear sprocket. No need to completely tighten the bolts until the wheel is back on the bike.
Step 7: Replace the front sprocket and clean the sprocket housing.
Be sure that you install the front sprocket facing the right way. Use the photos from the tutorials above if you aren't sure. No need to completely tighten the sprocket bolts until the chain is reattached.
Step 8: Install the rear wheel
Apply a thin coating of grease to the rear axle bolt. You'll need to be sure that the wheel spacers are all in place, line them up, and push the axle bolt through. I had a helper; this would be difficult to do on your own. Adjust the chain adjusters so that the wheel slides all the way to the front.
You can now put the brake caliper and muffler back in place. The brake caliper bolts go on fairly tight. I used a torque wrench and torque specs from cyclepedia.com to be sure.
Using a board, or a friend to hold the rear brake, torque the rear sprocket bolts.
Tighten the front sprocket bolts. The front bolts are very small and do not require a lot of torque. The torque setting was too small for my smallest torque wrench, so I just snugged it up.
Step 9: Install the new chain and master link
Feed the new chain through until both ends of the new chain are next to each other on the rear sprocket. This position makes it easy to install the master link.
Use your caliper to measure the diameter of the master link pin. My 520xso master link measured 5.23 mm. You'll need this initial width in order to confirm that the flare is wide enough.
Slide the master link on, along with o-rings. The RK masterlink came pre-greased, apply grease if your master link requires it.
Use the press plate on your chain tool to press the side plate of the master link onto the new pins. You must be sure that the holes on the press plate are not covering the pins of the master link!! With my chain tool, it was difficult to get lined up properly. Be patient and take your time. You must be careful not to over-press the plates!
Use your caliper to measure the distance between the existing plates on your chain and compare that with your master-link plates. Go slow and measure often. When you're finished, confirm that the chain is not binding on either side of the master-link.
Step 10: Flare the master link rivets
This was the most difficult step for me. On my first try, I over-flared and cracked the rivet.
If you, like me, ruined your first master link: Wrap a plastic bag around the chain to the left and right of the master link. Use your grinder to grind the master link rivets flat and use the chain tool to push them through. Head down to the store and buy another master-link. Better yet, buy two master-links so that you can practice with one, off the chain.
When you're ready to rivet the master link, apply the correct fittings for your chain tool and press the rivet tool into the pin head. Tighten the tool only 1/2 turn at a time. Remove, measure the flare width, and go again. It takes a while.
The maintenance and tips section of the RK site (http://rkexcelamerica.com/support/maintenance-and-tips or https://www.facebook.com/RkCambodiaTakasagoChain/photos/a.1437105633264470/1450144325293934/?type=1&theater) states "The flare can be as little as 0.152mm to 0.5mm but should never be over 0.7mm. The rivet pin should be flared just enough to keep the sideplate on, but not flared too much to bind the link."
Since, the initial width of my pin measured 5.23 mm, the minimal flare would be 5.23+0.152 = 5.38 mm. My flared pins measured at 5.47 mm and 5.58 mm and appear as shown below. The link above, from the RK site, includes more photos of proper and improper flares.
Step 11: Tension the chain and torque the rear axle bolt.
When you're finished, be sure to rotate the wheel, on the center stand in neutral, to confirm that the chain is operating properly before going for a test ride.





