XT, simple and quick to service. Tools needed, Chain whip and cassette tool to get the cassette out of the way. Cone spanners as above.
Get the cogs off, then undo one side locknut. Unscrew cone from one side. Pull out. Scrabble round on floor for the bearing you just dropped. Clean everything up, degrease/rinse all through with GT85. Dry off. Regrease, rebuild. Faff to get the bearings loaded just right. Tighten locknut. Done.
20mm hub? Prob just drifting out the old and in with the new bearing, but without knowing what it was, couldn't say more. Possibly post a pic up and some one might know, otherwise knowing what bike they started life on would be a start.