To take off and re-install a barrel on an AR requires some tools and know how. Even with the proper tools you can sometimes crack an upper. You will need a torque wrench for the re-install. You will also need a new gas tube.
Remove the 2 lower front sight pins.
Some early ones are taper pins, they have to be driven out small side to large side and can be a real b!tch to get out.
Later versions are screws or roll pins. Easy to remove.
Pull the front sight post/gas block forward with a slight back and forth twisting motion.
The gas tube will follow the front sight out and stay attached to the front sight/gas block.
If you are going to attempt to use the existing front sight/gas block, remove the gas tube roll pin and gas tube.
Install the new, shorter gas tube with roll pin.
When released, remove the hand guards and discard.
Remove the front hand guard retaining ring when the front sight post/gas block clears the barrel.
Discard the front hand guard retaining ring.
Remove barrel nut from upper receiver.
You will need a special wrench or pin spanner wrench to remove this nut.
Once barrel nut/rear hand guard retainer is removed, pull barrel free from upper receiver & discard.
DO NOT try and twist or wobble the barrel free from upper receiver!
If the barrel won't come out, use a 7/8" wooden dowel rod section to drive the barrel/extention nut out from inside the upper receiver.
Install new barrel/barrel extension by direct insertion.
DO NOT attempt to wobble or wiggle it in. Just line up the locating pin with the upper receiver notch, and push.
Reinstall the barrel nut and torque to 35 ft.lb.
Take care not to use the upper receiver as a handle when torquing, as it will twist if you do.
There is a special clamp you can use if you don't know how to isolate the upper receiver by using the front lug and/or optics rail.
This is where some knowhow will come into play...
When the barrel nut is tightened, it may interfere with the gas tube hole in the upper receiver...
This is NOT uncommon, and you will have to remove the barrel nut, barrel/extension from the upper receiver, and use another special tool to relieve some of the material from the front of the receiver.
This must be done exactly square with the receiver or your rifle will shoot stupid... Because the receiver and barrel are not square.
Once barrel nut is torqued into place and not interfering with gas tube alignment,
Install new front hand guard retaining ring.
Line up gas tube passage through the hand guard retaining ring so the gas tube will pass easily though into the upper receiver.
A spring and snap ring can block the passage.
Install front sight/gas block that came with your new barrel.
If you are trying to reuse your old front sight/gas block, make sure it fits VERY snugly...
DO NOT listen to anyone that tells you to slather a loose gas block with lock-tite or anything else to 'Tighten' it up.
The only way to 'Tighten' up a gas block is with the correct Inside Diameter gas block for your barrel.
Take care to guide the gas tube into the upper receiver while you are working the gas block onto the new barrel.
Once in place, tighten the screws, or replace the pins to secure.
Reinstall your 'Flash Supressor', and install the bolt/bolt carrier.
Use a cleaning rod or wooden dowel rod down the muzzle to the closed bolt face, and mark the muzzle location on the rod.
Remove rod, and measure. You MUST have a minimum of 16" in most states to be legal!
If you do have 16" or more, then install new carbine hand guards.
If you DON'T have 16" or more, then you MUST NOT ASSEMBLE THE BARREL ANY FURTHER!
To do so is illegal!
Find an extended muzzle 'Flash Hider' and use it to reach the 16" or more mark, then finish assembly.
Brownells and Midway both carry the tools necessary for squaring/relieving the upper receiver, the upper receiver vice blocks, the barrel nut tool, barrels, hand guards, gas tubes/gas blocks, ect.
Or you can just purchase a 16" complete upper then it is only two pins to pull and you have the upper off and ready for the other. I know that it is more cost in getting an full upper to a barrel only, but, If you don't have a torque wrench or access to one, a barrel wrench, upper vice block new gas tube and new foregrip. All of them together are close to a full upper. That also gives you the option of a full length rifle and a carbine in a matter of seconds by changing them. I bought a different upper so I could change out with one of my rifles. Then a few months later got a good deal on a new lower and parts kit, had a spair stock and bam had another full rifle.
If cost is an issue and you have no use for the 20" upper, buy the 16" full upper and put the 20" up on some equipment exchanges out there and recoop some of the cost.