The rear hub of a mountain bike is composed of 4 main parts.
The hub body which is what the spokes are attached to.
The freewheel which is a clutch mechanism for a bicycle, it allows the rider to roll without pedaling.
The axle which the hub rotates upon.
The cassette which is the set of gears on the rear wheel.
All current (1999+) Shimano rear hubs use cup and cone bearings with weather seals. An average Shimano rear hub will have to be stripped once at the start of summer and a couple times in winter depending on the wetness and muddiness of the local riding.
To dismantle the hub you need the following tools at a minimum.
2 cone spanners - one to fit the cone and one to fit the lock nut.
Cassette tool, supposedly universal but recent Shimano cassettes seem to be slightly different so be careful when you buy the tool. Park make very good mountain bike tools
A large (200mm+ length) spanner to fit the cassette tool.
A 10mm hex wrench to remove the freewheel.
Water resistant bearing grease.
About an hour for your first time, 30 minutes for subsequent runs
Ideally for easy work you also need
A third cone spanner to fit the other side.
A chain whip, for helping with removing the cassette, these are expensive for their total use and you can get by without one.
Remove the skewer and insert the Cassette tool into the cassette lock nut. Lock it into place with the springless skewer. The next part depends on whether you have a chain whip or not.
Without the whip you will have to wrap an old T-shirt or a fairly large amount of rags round the largest cog of the cassette, and through the spokes, if the plastic guard plate is still in place it will get tricky so you may have to use brute force to destroy the plate or get a chain whip. With the rags in place you can hold on to the cassette to stop it from rotating without turning your hands into mincemeat.
Using the large spanner on the cassette to unlock the cassette lock nut. The nut is held onto the freewheel by a set of radial ridges so a bit of brute force may be needed to loosen the nut. The larger your spanner the better at this point too.
Step 2 -
With the cassette off you can now slide the seal off the axle and use the cone spanners to remove the cone on the opposite side to the freewheel and slide the axle out. Watch out for the bearings as they may all fall out now that the axle has been removed. Work over a cloth to predisaster the environment.
If the bearings are rusty or not round replace them. The 17(?) bearings that you need should cost about $1 or less if you buy in bulk. Have a look at the cups on both sides. If you have left them so long that they are rusty or pitted then you may have to give up and get a new wheel.
Don’t bother removing the cone from the freewheel side of the axle as it makes a good placeholder and can be cleaned in place.
Use the 10mm hex to unscrew the freewheel axle from the body of the hub. Clean up the hub body and the freewheel then use plenty of light spray lubricant to get the freewheel moving well. Screw the freewheel back on with the hex wrench.
If your rear hub is slipping and you are really poor it is possible to service the freewheel by unscrewing the cups with a wide flat piece of metal that fits into the notches on either side of the bearing cup. Beware, inside is a lot of tiny bearings and the pawls which lock the freewheel ratchet. Again work over a cloth.
If the hub is slipping and you can afford to, replace the freewheel. Suntour and Shimano parts don’t play together well so replace like with like.
You shouldn't need to replace the freewheel more than once a year, any more and I'd be wondering whether you might need a winter single speed bike or a lesson in how to ride a mountain bike.
Replace the bearings into the freewheel cup gluing them in with grease and then slide the axle back in halfway through to hold the bearings in while you do the bearings on the other side.
Pack grease lightly around the bearings and slide the axle all the way through.
Screw the other cone back on and lock it place with the lock nut. With only two cone spanners you will have to over tighten the cone before locking so that it finishes right. Fill the seal with grease and slide it back onto the axle.
Making sure you have degreased the cassette and cleaned all the crap out from between the cogs slide it back onto the freewheel, and again using the skewer to hold the cassette tool in place, tighten the locknut.
Don’t over tighten as you want to able to get it off again at some point.
Remove the tool and reinsert the skewer with its springs and your wheel is ready for a bit more riding.