Line the ditch with gravel. If the ditch is overgrown with grass, scoop the grass out with a shovel first. The rational for removing the grass is to leave only bare dirt so that draining water can soak into it.
Wrap a perforated pipe in landscape mesh. This keeps dirt and debris from clogging the holes.
Place the pipe in the ditch with the perforate holes facing down. This allows water to flow into the pipe and move down the slope when there is too much for the ground to soak up. If there are culverts drain pipes on either end of the ditch for water to flow out of the yard, line the pipe up with the culverts. Use enough drain pipe so that it goes one foot or more into a culvert or so that it fits up against a drain pipe.
Pour gravel over the perforated drain pipe to completely cover it, then fill in with sand to with in 2 inches of the yard surface.
Spread two inches of top soil over the sand and pack it down with your feet. Sprinkle grass seed over the soil and then cover with 1/4 inch more soil.
Water the seeds daily until you see growth, then cut back to 2 inches of water per week.