When you want to overhaul your threaded headset, remove the handlebar stem and use a wrench for the locknut. Remove the spacers and the top race. Check the races for pitting. Remove fork and bearings. The bearings are normally in casings. Check these for pitting too (though because they are cheap, you could just as well buy new ones). Clean everything.
Once you've checked what is still usable (hopefully everything), turn the fork over and start with the bottom first. Put in grease, your bearings and then the fork. Secure the fork to the frame and flip the bike over, right side up.
Repeat with the top. Grease everything: locknut, bearings, anything that has a thread. Put your spacers on, followed by the locknut. Wipe off any excess grease that may still be on the bike.
Wrench the locknut tight and then test out your fork. If it doesn't turn smoothly, you'll have to see where you went wrong with previous steps.