The chain and sprockets should come as a complete kit (front sprocket, back sprocket and chain), so do the lot together.
Arm yourself with a Haynes manual, some decent tools (Halfords do decent tools for reasonable money), and if you can't get a knowledgeable friend to help you then look at YouTube for videos to give you an idea.
If you buy a good quality chain / sprocket kit (DID for example) and look after it, you should get 20k+ miles from it.