Contour Swales are a very effective way to harvest and store rainwater in the soil. Design and layout methods vary widely depending on goals, site size and location, soil type, rain availability, and several other elements.
What all contour swales have in common is using some form of site level (I use an easy-to-make A-fram level) to determine accurate site contours. The swale is dug along the contour and the soil dug out from the swale is used to form a berm. Some gardens have a contour swale for every single row, with vegetables planted on the berms. Other systems have swales placed at regular intervals and plant the berms with fruit trees. Very large systems can grow an entire forest behind each swale.
Check out this video of a hillside cross-section to see how contour swales work.