This can be done simply by using corks and bungs but the best way is to use a set of glassware with ground glass joints.
This is generally known as Quickfit glassware, although Quickfit is simply a brand name for the first, and best known, brand (a bit like Hoover becoming synonymous with vacuum cleaners).
You can find more information about assembling and using Quickfit apparatusĀ here.