Buy a water-repellent wood preservative.
Liberally paint the preservative on any part of the lumber that has been cut.
Soak wood that will be placed under ground with preservatives. Long contact with soil will cause the preservative to degrade faster and will require more care. Fill a bucket halfway with the water repellent. Place the cut end into the bucket for several minutes to allow the wood to absorb the preservative.