A few things you'll need:
-Gloves (it gets dirty)
-Extra latex glove
-Cone wrenches that match your hub. Most are 13mm and 17mm, but they vary.
-Toothbrush (preferably your roommate's)
-Towel (preferably a clean washcloth, but paper towels are probably best since it'll be ruined the moment you use it)
-A clean, open workplace where you can find loose bearing balls that shoot off into the nevernever
You'll need some kind of cleaner for the grease, but I left this out because you can use damn near anything. The bearing balls are stainless steel, so you're not going to hurt them. I've used WD-40 for as long as I can remember, but I used windex this time and it worked fine. Residue isn't a real problem because you'll wipe them down on the paper towel before you put them back in.
Step 1: Get in There!
The axle is not held in with anything except those cones, so once you start to loosen them up, the bearing balls can fall out. The dust cover helps, but not all hubs have them and even with them the balls can fall out. You'll want the wheel sitting on the table while you do this so the axle is always pressed into the hub.
Step 2: Getting to the Bearings
The nuts on the other side of the axle do not need to be removed, so it's a good idea to take your cone wrench(es) and tighten the cone and nut together to make sure they stay put when you reassemble the hub.
Step 3: Cleaning
Now wipe the insides of the hub off with the towel and spray something in there and go at it with the toothbrush. Some will be dirtier than others, but as long as you don't have a bunch of pitting in there, you'll be able to clean it off just fine.
Do the same with the axle and cones and such. While you have it apart, why not make it all purty and shiny!
Step 4: Greasing
Do this to both sides so that it's ready when you get the bearing balls in on one side. It's difficult to grease the inside when the axle is in there, and once you put that axle in, you don't want to take it out.
Step 5: Axle and Bearing Ball Replacement
Since you are just putting your old ones back in, you have the right number, but just to be sure the person before you did it right, make sure there isn't very much space between the balls once they're all in. The amount in there should be the max allowed. If you add one more, they won't sit right in the cup. Make sure you're using exactly half the bearing balls you have on the table. Both sides of the hub should have the same number.
Now's the time to put a dust cover in there if you want. If yours aren't in very good condition (or not present at all), don't worry about putting it back in. I have hubs with and without dust covers and they both do just fine. If you're some extreme mountain biker who rides through dusty trails every ride, it might help, but hubs were doing fine for decades without them.
Now, take the axle, put a bit of grease on the cone, then slide it in there. Don't whack the bearing balls and knock them loose.
Step 6: Other Cone
Thread the cone on there and put some grease on it. Hand tighten it down until it stops, then back off a quarter turn. Now we're at the toughest part!
Step 7: Fine Tuning
Since you're using all the same parts and you didn't move the lock nut and cone on one side, this shouldn't be a problem, but it's a good idea to check anyway: the axle should be sticking out of the hub on either side about the same amount. This is important because each side needs to be sticking out enough to bear the load from the frame dropouts, but if either side is sticking out TOO much, the skewer won't tighten down onto the frame. This is less of a concern if you have a solid axle and nuts.
Congrats! You conquered your first hub! The rear hub is tougher, but only because of the spacing and placement of the cones along the axle. If you figured the front hub out, the rear is totally doable.
I did this at TechShop San Jose!