If drum brakes in back, undo drum retaining screw(s) and remove drum. If disc undo caliper attaching bolts and carefully bend caliper up and out of the way.
Pop off dust cap. Undo spring clip if equipped along with shims and set aside.
Remove the drive flange bolts (5) and set aside. Withdraw axle shaft if one piece, or remove drive flange and set aside.
You will see a large washer that has been bent. Using a flat screwdriver and a mallet, drive the bend flat so that the nut can be removed. remove nut, washer, inner nut, thick washer. Pull outward on hub being sure to catch the bearing if it falls out.
To dismantle hub, pry out inner hub seal and remove inner bearing cage. You should be left with only the bearing cups in the hub. Drive these out using a long drift or punch. Work from one side to the other rocking them out.
Thoroughly clean hub inside.
lightly grease outside of bearing cups and drive them in using the old cups as buffers. You'll reach a point where the old cups will get stuck so switch to your brass drift when that happens. Alternately, take the hub and cups to a shop and have them press in the cups. Cost should be minimal.
Thoroughly pack the inner race with new grease, drop it in hub and install new inner hub seal. Pack in more grease. Install hub onto stub axle. Grease outer race and cup and slide onto stub axle. Install thick washer, adjusting nut and adjust hub. Install new flat washer and locknut and tighten, Check hub for runout. If happy, bend up one side of the flat washer to lock the outer nut in place. Put the rest back together with new gasket on drive flange.
I would say here that this should be done in conjunction with new rotors and pads or drums and shoes. Since that job requires as much effort as the new bearings the two jobs done at the same time is a time saver.