The cups in the hubs are pretty tough so you might be ok. The cones are usually softer metal and get chewed up first.
Take the wheel off and remove the quick release skewer.
Undo the nut on the non-gear side and screw it off. Remove the washer and screw off the cone, as you screw the cone out you'll feel the threaded spindle come loose.
Pull the spindle out from the gear side looking out for ball bearings stuck to grease on the cones and spindle.
Use a small magnetic pen/tool to pull out all of the ball bearings. Count the balls in each side. Clean the balls, cones and insides of the hub with rags and white spirit or de-greaser.
Inspect the cones and hub cups for damage. A smooth track where the balls run is fine but chips or cracks are bad. Balls should be perfect.
Any damage to the balls, replace them.
Any damage to the cones, replace them.
Any damage to the cups and you have a choice!
Damaged cups mean that you'll need to replace the whole hub. However, as the hubs are already damaged, there is no harm in continuing to use them. If you fit new balls and grease the hub might run ok for a good while yet. It's days are numbered but a good clean etc might give you bit more life out of it.
To reassemble, pack the cups with grease and push the balls into it.
When you put the cones and nuts back on you want to lock them up so that you can feel a tiny amount of play. The quick release tightens the cones slightly which takes the play up.
With the wheel tightened onto the bike, rock the wheel from side to side and feel for any play. Also let the wheel spin round, it should be very free and smooth with no roughness or sticking. If the wheel isn't right remove it from the bike and ajust the cone again.
If you need new ball bearings you can get them for a few pounds from any bike shop. Just take the old ones with you and they'll give you the right size.