Brenden has provided you with documentation. However if you are looking for specific code to solve your problem you can do something like this.
// Gets the latest edited version of child pages stored under the '/Articles/' path
// The pages are retrieved from the Dancing Goat site and in the "en-us" culture
// Replace Path and SiteName to match your site
var pages = DocumentHelper.GetDocuments()
.Path("/Articles/", PathTypeEnum.Children)
.WhereLike("DocumentName", "Coffee%")
.OnSite("DancingGoat")
.Culture("en-us");
// Updates the "DocumentName" and "ArticleTitle" fields of each retrieved page
// You should perform your logic here. In this case It is updating the DocumentName and ArticleTitle
foreach (TreeNode page in pages)
{
// Checks if the page isn't already checked-out
if (!page.IsCheckedOut)
{
// Checks out the page
page.CheckOut();
page.DocumentName = "Updated article name";
page.SetValue("ArticleTitle", "Updated article title");
// Updates the page in the database
page.Update();
// Checks in the page
page.CheckIn();
}
}
This should help you achieve most of what you are looking for