AR barrels are head spaced using a bolt gauge, chamber gauge, and reamer to set the throat in the chamber that determines the distance at which the shoulder of the cartridge will sit when seated against the bolt face. this is done by the barrel maker: once a given barrel has the chamber reamed to the desired specification, the barrel maker will temporarily install the barrel extension (threaded portion with a flange that supplies clamping force for the barrel nut to tighten against the upper receiver to secure the barrel). the head space of the combined barrel extension and barrel is checked with the bolt gauge and chamber guage and if needed, the barrel extension has material removed from the shoulder to bring it into specification. once the assembly is in specification, the barrel extension is torqued to the barrel, more or less mating the two together for life. the extension is then drilled and an index pin installed top dead center and the barrel then has a gas port drilled and front sight block drilled and pinned (typically).
it isn't really common for a home builder to head space their own AR pattern barrel unless they're planning on assembling the barrel extension and barrel together. even precision shooters will opt to bed a rifle or replace a barrel assembly as a whole unit than replace just the one part. buying a barrel assembly from a reputable maker will generally result in a properly head spaced barrel and barrel extension. combined with setting appropriate torque between the steel barrel extension and the aluminum upper receiver, head space is largely done for you already.
to assemble a typical upper (assuming an AR-15) you will need an armorer's wrench, a torque wrench (3/8" or 1/2" depending on barrel nut, some after market free float tubes use a unique barrel nut and wrench), a 1/8" pin punch, a 5/16" pin punch, 3/32" pin punch, a 1/8" roll pin punch (holder and starter punches are handy), a 3/32" roll pin holder and starter, a drill jig for the front sight block if you do not have a barrel assembly with one already installed (or appropriate fixture for your gas block as per it's instructions from the manufacturer), some aeroshell molybdenum disulfide/lithium grease (for the threads on the barrel nut to prevent galling), and the requisite parts. i strongly recommend a vise with plastic or brass (or other soft material like delrin) jaws, a non marring 1lb mallet, a 4oz brass or steel hammer (for pin driving), a scratch awl (or something to mark drill centers although an automatic center punch is convenient too), and general access to simple hand tools. for some after market free float tubes or rails, you might need some torx or hex wrenches, needle nose pliers are also handy to save fingers when driving pins or squeezing the gas tube roll ping into the FSB.
i recommend some tutorial videos on youtube or reading AR-15 builder's guide online. there are a great many resources for assembling your own upper receiver group, and if you know what you want, you can really fine tune your build into a rifle you can be proud of.
US Army TM9-1005-319-23 is the Technical Manual covering details of the M16 and similar rifles.
edit: re-worded and added some detail on AR-15 barrel head spacing.