In StarCraft II there are two types of add-ons: reactor and tech lab. The reactor allows you to train two units simultaneously. The tech lab allows you to train higher-end units. You can only have one add-on connected to a structure at a time. The following structures allow add-ons: barracks, factory, and starport.
You can construct an add-on, lift-off, then land and create another add-on. If you want to switch between the two add-ons later on, you can lift-off, and land at the next add-on.
Add-ons are also interchangeable between buildings. For example, use a barracks to create a reactor, lift-off to get the Barracks out of the way, and land a factory next to the reactor.
When constructing structures that support add-ons, be sure to keep the right side free of obstructions when you place it. While it's easy to lift-off the structure and move it to a place where the add-on can be built, it's much more efficient to place your structures cleanly from the get go; this way you'll have space to build without having to move them around.
If you lift-off your structure, the add-on can by claimed by any other terran in the game (ally or enemy), who can land a structure next to it. It is possible to capture or use abandoned add-ons, although this isn't something that happens often.
If the main structure is destroyed but the add-on remains, reuse it by rebuilding in the same spot.
Reactors, just like the mule, are necessary to compete with the zerg's larva spawn and and protoss' chrono boost abilities. However, while the other races can increase the massability of any unit in their arsenal, terrans only get to increase the massability of 4 of their units, one of which is essentially a support unit. Furthermore, terrans require the most unit production structures of any race, and they also have to spend additional resources outfitting each of them with either a reactor or a tech lab. This is especially notable compared to the zerg, where queens significantly reduce the amount of required production structures to field a sizable army.
As a result, it is more costly to mass any terran unit that requires a tech lab, as you will need to build more production structures. Reactors, on the other hand, will be more cost effective, but cannot be used to pump out higher tier units. Mix, match, and strike a balance to get those armies going. If things aren't looking too good, or you need certain types of units, remember, a shift in production focus is just a lift-off away.