The best way to install underground garden drainage is to dig trenches at a slight slope away from the problem area, line the trenches with landscape fabric, add a layer of gravel, and then install perforated pipes. Cover the pipes with more gravel and then backfill the trenches with soil. It's important to make sure the drainage system is properly sloped and that the pipes are installed with the perforations facing downwards.