If it's badly out, then starting from scratch is fairly simple. Get the shift lever to the position where it should be on the smallest cog, then loosen the cable at the mech. Check the limit screws are ok by moving the mech manually and visually checking the alignment - I'd guess they are probably ok if they've not been touched. Then re-attach the cable, using pliers to keep a reasonable tension in the cable. You should find the indexing will be close after using the adjuster to tighten out any remaining slack in the cable so that the first click on the shifter just moves the chain to the next cog. Then it should be a case of some fine adjustments with the adjuster - nor more than half a turn at a time, and making sure that the chain goes up and down the whole cassette. I've changed mechs and cables plenty of times and never taken more than a few minutes to get the indexing working. It will generally need some minor adjustment again after the first couple of rides as cable tension eases.